Image Optimization In Yii

Hi Friends…

      I have a registration form, On that I have user profile image field. The case is if user can upload image at any size. but I need to reduce the size of image and I save it in the Protected/images, as well as in db.

      Is that possible to change the image in to particular size???  eg: All images into 30kb. can we done this with yii..

thank you…

help me out!!!

Hello vijay p. this is not Yii work, you can find many resources that handles image manipulations like Imagine. will help you.

Am solving the Problem…

with the help of this now it quite easy to use simple instruction to follow. thanks for that article…

the only change you want to do is


. jst copy paste it and gave the correct path to save image.

in your controller.php




                                        $image = new Image(Yii::app()->basePath.'/../images/'.$model->image);

                                        //CVarDumper::dump($image, 10, true);

                                        $image->resize('75', '75');   


use it and thank you