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

Roan Horning roan at horning.us
Thu Nov 8 21:12:25 PST 2007


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



More information about the clipart mailing list