I have used used image extension to resize the image. Its working fine. Here is the Code
$image = Yii::app()->image->load(Yii::getPathOfAlias('webroot').'/files/galaryimages/'.$fileName);
$image->resize(900, 600)->quality(75)->sharpen(20);
$image->save();
but I need to resize only if the image size is greater than a fixed width and height How can I do this?
http://www.yiiframework.com/extension/image/#hh5
Used the below code
list($width1, $height1, $type1, $attr1) = getimagesize(Yii::getPathOfAlias('webroot').'/files/images/'.$fileName);
if(($width1>$width) || ($height1>$height))
{
//code to resize
}