Программирование
10
Вклад в тег
$img = imagine\Image::getImagine()->open(Yii::getAlias($fullName));
$size = $img->getSize();
$ratio = $size->getWidth()/$size->getHeight();
$width = 200;
$height = round($width/$ratio);
$box = new Box($width, $height);
$img->resize($box)->save($filePath.'/thumb/' . $fileName);
// OR:
imagine\Image::thumbnail($fullName,$width,$height)
->save($filePath.'/thumb/' . $fileName);