Skip to content
slav123 edited this page Dec 8, 2011 · 3 revisions

CodeIgniter library to generate high quality thumbnails

Library is based on excellent * Smarty plugin >Thumb> * created in 2005 by Christoph Erdmann. This version is a little bit different, we are using core from Thumb, and some modification which gives more flexibility to work with it.


  • thumbnails are generatoed “on the fly” no addtional actions required,
  • cache for generated thumbnails,
  • clear structure for generated thumbnails,
  • thumbnails sharpening function,
  • cropping function,
  • fill space function Usage You need to upload file img.php into directory application/libraries. In controller you need to load library:


In view you can use function with this parameters:

echo $this->img->rimg($filename, array('longside' => 745, 'alt' => 'alt text')


longside – width of longest side (pixel value), shortside – width of shorter side crop – cropping (true/false) width – fixed width (with this parameter you need also set height) height – height (with this parameter you need to also set height) sharpen – sharp image after scale nocache – rewrite existing file in the cache

Clone this wiki locally