image extension

hi! everybody!

I am newbie!

I prefer to use imageextension.

I have done:

[u]Installation ¶

* Extract image folder under protected/extensions

* Extract helpers folder under protected

Usage ¶

The following code is the component registration in the config file:









        // GD or ImageMagick


        // ImageMagick setup path




but I do not know where to put these code:

[b]$image = Yii::app()->image->load(‘images/test.jpg’);

$image->resize(400, 100)->rotate(-45)->quality(75)->sharpen(20);

$image->save(); // or $image->save(‘images/small.jpg’);



$image = new Image(‘images/test.jpg’);

$image->resize(400, 100)->rotate(-45)->quality(75)->sharpen(20);


Anybody would help? where to put these code?

in your controller probably, but you should know better…

clearly, please…

I can not make it useful…


It really depends on your purpose,

If you want to resize the image as soon as it is uploaded , then as uploading is handled in controller , you would put that in controller.

You can just give it a try by creating an empty view and post something like this:



$image = Yii::app()->image->load($realpath.$url.'1_New.gif');

$image->resize(100, 100)->rotate(-45)->quality(75)->sharpen(20);

//echo var_dump($image);


Obviously take care of those $url and image names.

Btw, if you are using in windows -

change -




Then it would work.