Skip to content

Commit

Permalink
Relocate Watermark insert on image after resize. #25514
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Krielen committed Nov 8, 2019
1 parent 8112a38 commit 85415ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/code/Magento/MediaStorage/Service/ImageResize.php
Expand Up @@ -311,6 +311,10 @@ private function resize(array $imageParams, string $originalImagePath, string $o
]
);

if ($imageParams['image_width'] !== null && $imageParams['image_height'] !== null) {
$image->resize($imageParams['image_width'], $imageParams['image_height']);
}

if (isset($imageParams['watermark_file'])) {
if ($imageParams['watermark_height'] !== null) {
$image->setWatermarkHeight($imageParams['watermark_height']);
Expand All @@ -331,9 +335,6 @@ private function resize(array $imageParams, string $originalImagePath, string $o
$image->watermark($this->getWatermarkFilePath($imageParams['watermark_file']));
}

if ($imageParams['image_width'] !== null && $imageParams['image_height'] !== null) {
$image->resize($imageParams['image_width'], $imageParams['image_height']);
}
$image->save($imageAsset->getPath());

if ($this->fileStorageDatabase->checkDbUsage()) {
Expand Down

0 comments on commit 85415ef

Please sign in to comment.