This is a helper for creating and caching thumbnails. Based on PHPThumb, The benefit over the image component ported from kohana is that it allows more resizing methods (like adaptive resize.
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
- The directory of the image needs to be writable... it will create a .tbm directory with all thumbnails for caching.
Installation ¶
- Extract the release file under
protected/
Usage ¶
See the following code example, it defaults to adaptive resize:
<?php echo Yii::app()->request->baseUrl.ImageHelper::thumb(600,800,$img, array('method' => 'resize'));?>
Default is:
<?php echo Yii::app()->request->baseUrl.ImageHelper::thumb(600,800,$img, array('method' => 'adaptiveResize'));?>
You can use the 3rd parameter for all options of PHP Thumb look on github for the documentation.
github.com/masterexploder/PHPThumb/
Change Log ¶
August 15, 2010 ¶
- Initial release.
Thanks
Nice
Thanks
Nice work!!
Thanks
Thanks, implemented!
Lack of options
Works as advertised but the lack of options means the class needs to be modified directly.
Also, 'ExceptionClass' needs to be renamed to 'CException'.
Resize small image to big
Why when I load small image for example 15x15, it changed at at 600x600. How make small pictures haven't changed?
Yii::app()->image->load($image)->resize(800, 600)->save();
good extension
thank you
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.