[Clipart] [Cctools-cchost] function for generating png thumbnails from svg files

Jon Phillips jon at creativecommons.org
Thu Nov 8 22:18:12 PST 2007


I was originally thinking that all formats have some form of thumbnail
for them...for graphics they are graphics, and for audio they are audio
snippets, etc...but I think too generally too often...will review
below...

On Fri, 2007-11-09 at 00:12 -0500, Roan Horning wrote:
> Hi,
> 
> I've started working on defining some classes to help isolate how the 
> thumbnails are created from how the thumbnail is called in the code.
> 
> The following is my pseudo class code which shows the public methods 
> that will be available. Please let me know if these look reasonable. I'm 
> new to writing objects, so this is a learning experience for me.
> 
> class CCGraphic {
> 	
> 	public function QueryWidth {
> 		return(this->$width);
> 		}
> 	public function QueryHeight {
> 		return(this->$height);
> 	}
> 	public function QueryLongSide {
> 		if ($width > $height) {
> 			return(this->$longside("width"=>$width);
> 		} else {
> 			return(this->$longside("height"=>$height);	
> 	}
> }
> 
> class CCGraphicConverter extends CCGraphic
> 
> 	public function Thumbnail($thumbnailSize, [$affix]) {
> 	/* Returns a thumbnail whose long side is set to $thumbnailSize.
> 	The long side of the original graphic determines the long size
> 	of the thumbnail. The image is scaled proportionally. $affix
> 	will be a coded string that will tell the function whether and
> 	how to add a suffix or prefix to the thumbnails filename. All
> 	thumbnails will be of filetype PNG.
> 	*/
> 	}
> 	public function Resize($newWidth, [$newHeight], [$affix]) {
> 	// Possible future function.
> 	}
> 	public function Convert($newType, [$newWidth], [$newHeight] {
> 	// Possible future function.
> 	}
> }
> 
> Thanks,
> 
> roan

This thinking looks fine to me...you are nearly there!

Jon

> _______________________________________________
> clipart mailing list
> clipart at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/clipart
-- 
Jon Phillips
jon at creativecommons.org
cell: +1.510.499.0894 (80% time)
desk: +1.415.369.8486 (20% time)

Business + Community Manager
Creative Commons
www.creativecommons.org


Please note: the contents of this email are not intended to be
legal advice nor should they be relied upon as or represented to be
legal advice.  Creative Commons cannot and does not give legal advice.
You need to assess the suitability of Creative Commons' tools for
your particular situation, which may include obtaining appropriate
legal advice from a licensed attorney.




More information about the clipart mailing list