[Extension] Easyimage. Easy Creating And Caching Thumbnails On Real Time.



  • Easy to use

  • Support GD and Imagick

  • Automaticly thumbnails caching

  • Cache sorting to subdirectories

  • Based on Kohana Image Library (3.3)

More: https://github.com/zhdanovartur/yii-easyimage

Thanks to Artur.

It’s very easy to use. I used this in my CDetailView, CJuiDialog, and CGridView, and very easy to plug-in.

Below is just one example:

<?php $this->widget('zii.widgets.grid.CGridView', array(












                    "onMouseOver"=>"bigImg(this);return false;",

                    "onMouseOut"=>"normalImg(this);return false;",




I did not use resize in here, is because I want to create mouse over to show larger size picture, which looks like bing image search.

And also to prevent the code broken due to the image file does not exist, I added "file_exists()" check in the "thumbOf" function, if file is not exists, then it will return message, additional change is to added escapeshellcmd to the file name, so make sure it allow white space or other characters in the file name on Linux:

public function thumbOf($file, $params = array(), $htmlOptions = array())





            return "Image file is not found!";




            return CHtml::image($this->thumbSrcOf($file, $params), isset($htmlOptions['alt']) ? $htmlOptions['alt'] : '', $htmlOptions);



One of the best functions I like is "Automaticly thumbnails caching", this make the page very fast, and also hide my original image files.