Skip to content

Commit

Permalink
Fixed Null as height
Browse files Browse the repository at this point in the history
  • Loading branch information
notesz committed Oct 8, 2018
1 parent d8f472a commit 868cde7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ImageResize.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* $image->setType('large', 640, 480);
* $image->setType('medium', 320, 240);
* $image->setType('thumbnail', 160, 120);
* $image->setType('content', 320, null);
*
* $image->setSource('/home/notesz/images/0001.jpg');
* $image->setTarget('/home/notesz/images/resized');
Expand Down Expand Up @@ -403,10 +404,10 @@ public function resize()
$imageRotation = 'square';
}

if ($imageType['height'] == null) {
if ($imageType['sizeHeight'] == null) {

$width = $imageType['width'];
$height = \round($imageHeight/($imageWidth/$imageType['width']));
$width = $imageType['sizeWidth'];
$height = \round($imageHeight/($imageWidth/$imageType['sizeWidth']));

$img->resizeImage(
$width,
Expand Down

0 comments on commit 868cde7

Please sign in to comment.