bynd
(Byndstd)
1
Hello I’m using imagine\Image for uploading images and it’s work perfect except for resizing image I Have to give the width and height.
Is it possible to resize image only by height but for width do it automatically ?
I tried to change width to 0, but I get error.
my code for uploading is :
$GalleryImage->saveAs($GalleryThm . $GalleryName . '.' . $GalleryImage->extension, false);
Image::thumbnail($GalleryThm . $GalleryName . '.' . $GalleryImage->extension, 150, 150)
->save(Yii::getAlias($GalleryThm . $GalleryName . '.' . $GalleryImage->extension),
['quality' => 100]);
evstevemd
(Stefano Mtangoo)
2
I guess no. But since you can know the size of image, calculating required height should not be difficult