Skip to content

Commit 48bf67d

Browse files
committed
cast framewidth/height as float to prevent string values for round methods.
1 parent 7eadc26 commit 48bf67d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,14 +562,14 @@ 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;
568571
list($dstWidth, $dstHeight) = $this->_checkAspectRatio($frameWidth, $frameHeight);
569572

570-
$frameWidth = (float)$frameWidth;
571-
$frameHeight = (float)$frameHeight;
572-
573573
// define position in center
574574
// TODO: add positions option
575575
$dstY = round(($frameHeight - $dstHeight) / 2);

0 commit comments

Comments
 (0)