ephpthumb

a lightweight wrapper for the phpThumb library
11 followers

This is a lightweight extension for the well known phpThumb library. There are a lot of extensions out there providing a lot more functionality but they can be total overkill for just creating some thumbnails and saving them to disk. If you just want a simple wrapper for phpThumb then this extension is the right one.

Requirements

Yii 1.1.x

Usage

In your main.php

'phpThumb'=>array(
    'class'=>'ext.EPhpThumb.EPhpThumb',
    'options'=>array(optional phpThumb specific options are added here)
),
$thumb=Yii::app()->phpThumb->create('../images/myImage.jpg');
$thumb->resize(100,100);
$thumb->save('../images/thumb.jpg');

For more information visit the phpThumb documentation.

Resources

Total 2 comments

#6676 report it
speedlog at 2012/01/27 12:42pm
If you don't want to put it in main.php
Yii::import("ext.EPhpThumb.EPhpThumb");
 
$thumb=new EPhpThumb();
$thumb->init(); //this is needed
 
//chain functions
$thumb->create('../images/BIG.jpg')
      ->resize(200,200);
      ->save('../images/SMALL.jpg');
#6659 report it
sidewinder at 2012/01/26 02:24am
Good job

Exactly what I needed. Thank you! Been using WideImage before, but for simple thumbnails creation phpThumb is so much better.

Leave a comment

Please to leave your comment.

Create extension
Downloads