Skip to content

Commit

Permalink
[2.3-develop] Forwardport of #11060
Browse files Browse the repository at this point in the history
  • Loading branch information
magento-engcom-team committed Feb 6, 2018
1 parent ecafa80 commit a15208e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/internal/Magento/Framework/Image/Adapter/ImageMagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,26 @@ public function watermark($imagePath, $positionX = 0, $positionY = 0, $opacity =
$offsetY = $positionY;
while ($offsetY <= $this->_imageSrcHeight + $watermark->getImageHeight()) {
while ($offsetX <= $this->_imageSrcWidth + $watermark->getImageWidth()) {
$this->_imageHandler->compositeImage($watermark, \Imagick::COMPOSITE_OVER, $offsetX, $offsetY, $compositeChannels);
$this->_imageHandler->compositeImage(
$watermark,
\Imagick::COMPOSITE_OVER,
$offsetX,
$offsetY,
$compositeChannels
);
$offsetX += $watermark->getImageWidth();
}
$offsetX = $positionX;
$offsetY += $watermark->getImageHeight();
}
} else {
$this->_imageHandler->compositeImage($watermark, \Imagick::COMPOSITE_OVER, $positionX, $positionY, $compositeChannels);
$this->_imageHandler->compositeImage(
$watermark,
\Imagick::COMPOSITE_OVER,
$positionX,
$positionY,
$compositeChannels
);
}
} catch (\ImagickException $e) {
throw new \Exception('Unable to create watermark.', $e->getCode(), $e);
Expand Down

0 comments on commit a15208e

Please sign in to comment.