A Yii extensions that helps to create thumbnail.
CThumbCreator actualy suports the creation of thubnails and cut images. You can save you images or simply show it on the screen.
protected/extensionsYou can se the documentation in the google code project page
http://code.google.com/p/cthumbcreator/ http://code.google.com/p/cthumbcreator/
Total 3 comments
Hi Lukz,
Nice thing! I encountered a smal problem in the case where filenames (and their extensions) are relevant to an application.
I resized a .jpg file, but from the mimetype, the extension is derived as .jpeg. Therefore, if you have a file foo.jpg, it's thumb will have an extension of foo.jpeg (if the name is 'foo' ;-)). I changed the getImage method as follows (first line is your code, I added the rest):
// line 150 $this->ext = strtolower(end(explode("/",$this->image_info["mime"]))); if ($this->ext == 'jpeg' && 'jpg'==self::getExtensionName($this->image)) { $this->ext = 'jpg'; }where the getExtionsionName function is implemented as
public function getExtensionName($filename) { if(($pos=strrpos($filename,'.'))!==false) return (string)substr($filename,$pos+1); else return ''; }Maybe you may add it. Thanx again for this nice thing.
Hi trustdnb. Thank for reporting.
I was uploaded the previous version of the class, this is the problem. But now I re-uploaded the class in the correct version. I edited the documentation too.
The bug in the cropCenter() method was corrected too.
Thanks
Nice class. Obrigado!
A couple of things: the documentation mentions both a "name" property and a makeThumb() method that do not seem to exist. I think these are supposed to be "defaultName" and "createThumb()" respectively.
The "cutCenter" is not to working for me -- it appears that "$this->cropWidth" and "$this->cropWidth" are not set in the class. Are they supposed to be set by the user? If so, what sort of values are we to use?
The argument to your imagepng function contains an undefined variable "$novo_nome." Is this supposed to be the case?
Pardon my ignorance if I am missing something.
Leave a comment
Please login to leave your comment.