Yii 1.1: cthumbcreator

Easily create thumbnails with this extension
2 followers

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.

Total 3 comments

#928 report it
mlindhout at 2010/01/28 03:07am
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):

// 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.

#1033 report it
Raziel at 2010/01/05 06:02am
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

#1035 report it
Muhammad at 2010/01/05 01:16am
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 to leave your comment.

Create extension