Skip to content

Commit

Permalink
Watermark added explode on size ([Width]x[Height] to $size['Width','H…
Browse files Browse the repository at this point in the history
…eight']) . #25514
  • Loading branch information
Jack Krielen committed Nov 8, 2019
1 parent 85415ef commit 2263d2e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/code/Magento/Catalog/Model/Product/Image/ParamsBuilder.php
Expand Up @@ -130,10 +130,12 @@ private function getWatermark(string $type, int $scopeId = null): array
);

if ($file) {
$size = $this->scopeConfig->getValue(
"design/watermark/{$type}_size",
ScopeInterface::SCOPE_STORE,
$scopeId
$size = explode(
'x',
$this->scopeConfig->getValue(
"design/watermark/{$type}_size",
ScopeInterface::SCOPE_STORE
)
);
$opacity = $this->scopeConfig->getValue(
"design/watermark/{$type}_imageOpacity",
Expand All @@ -145,8 +147,8 @@ private function getWatermark(string $type, int $scopeId = null): array
ScopeInterface::SCOPE_STORE,
$scopeId
);
$width = !empty($size['width']) ? $size['width'] : null;
$height = !empty($size['height']) ? $size['height'] : null;
$width = !empty($size['0']) ? $size['0'] : null;
$height = !empty($size['1']) ? $size['1'] : null;

return [
'watermark_file' => $file,
Expand Down

0 comments on commit 2263d2e

Please sign in to comment.