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.
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/extensions
You can se the documentation in the google code project page
http://code.google.com/p/cthumbcreator/ http://code.google.com/p/cthumbcreator/
Change Log ¶
January 4, 2010 ¶
- Initial release.
jpg/jpeg filename issue
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):
$this->ext = 'jpg';
}
where the getExtionsionName function is implemented as
if(($pos=strrpos($filename,'.'))!==false) return (string)substr($filename,$pos+1); else return '';
}
Maybe you may add it. Thanx again for this nice thing.
Problems Solved
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
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.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.