Skip to content

Commit e6741be

Browse files
committed
cast values.
1 parent d14ec6b commit e6741be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ protected function _adaptResizeValues($frameWidth, $frameHeight)
562562
}
563563
}
564564

565+
$frameWidth = (float)$frameWidth;
566+
$frameHeight = (float)$frameHeight;
567+
565568
// define coordinates of image inside new frame
566569
$srcX = 0;
567570
$srcY = 0;
@@ -609,10 +612,7 @@ protected function _checkAspectRatio($frameWidth, $frameHeight)
609612
}
610613
// keep aspect ratio
611614
if ($this->_imageSrcWidth / $this->_imageSrcHeight >= $frameWidth / $frameHeight) {
612-
$dstHeight = max(
613-
1,
614-
round($dstWidth / $this->_imageSrcWidth * $this->_imageSrcHeight)
615-
);
615+
$dstHeight = max(1, round($dstWidth / $this->_imageSrcWidth * $this->_imageSrcHeight));
616616
} else {
617617
$dstWidth = round($dstHeight / $this->_imageSrcHeight * $this->_imageSrcWidth);
618618
}

0 commit comments

Comments
 (0)