Skip to content

Commit

Permalink
Merge pull request #1 from craig-bartlett/issue-35535-cast-floats-to-…
Browse files Browse the repository at this point in the history
…ints

magento#35535: Magento 2.4.4 Mini cart item images not showing
  • Loading branch information
craig-bartlett authored Oct 26, 2022
2 parents 5a022f6 + 5131a55 commit f402686
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/Image/Adapter/Gd2.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ private function createWatermarkBasedOnPosition(
} elseif ($this->getWatermarkPosition() == self::POSITION_STRETCH) {
$watermark = $this->createWaterMark($watermark, $this->_imageSrcWidth, $this->_imageSrcHeight);
} elseif ($this->getWatermarkPosition() == self::POSITION_CENTER) {
$positionX = $this->_imageSrcWidth / 2 - imagesx($watermark) / 2;
$positionY = $this->_imageSrcHeight / 2 - imagesy($watermark) / 2;
$positionX = (int) ($this->_imageSrcWidth / 2 - imagesx($watermark) / 2);
$positionY = (int) ($this->_imageSrcHeight / 2 - imagesy($watermark) / 2);
$this->imagecopymergeWithAlphaFix(
$this->_imageHandler,
$watermark,
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ public function watermark($imagePath, $positionX = 0, $positionY = 0, $opacity =
$watermark->sampleImage($this->_imageSrcWidth, $this->_imageSrcHeight);
break;
case self::POSITION_CENTER:
$positionX = ($this->_imageSrcWidth - $watermark->getImageWidth()) / 2;
$positionY = ($this->_imageSrcHeight - $watermark->getImageHeight()) / 2;
$positionX = (int) (($this->_imageSrcWidth - $watermark->getImageWidth()) / 2);
$positionY = (int) (($this->_imageSrcHeight - $watermark->getImageHeight()) / 2);
break;
case self::POSITION_TOP_RIGHT:
$positionX = $this->_imageSrcWidth - $watermark->getImageWidth();
Expand Down

0 comments on commit f402686

Please sign in to comment.