Skip to content

Commit 2263d2e

Browse files
author
Jack Krielen
committed
Watermark added explode on size ([Width]x[Height] to $size['Width','Height']) . #25514
1 parent 85415ef commit 2263d2e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/code/Magento/Catalog/Model/Product/Image/ParamsBuilder.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ private function getWatermark(string $type, int $scopeId = null): array
130130
);
131131

132132
if ($file) {
133-
$size = $this->scopeConfig->getValue(
134-
"design/watermark/{$type}_size",
135-
ScopeInterface::SCOPE_STORE,
136-
$scopeId
133+
$size = explode(
134+
'x',
135+
$this->scopeConfig->getValue(
136+
"design/watermark/{$type}_size",
137+
ScopeInterface::SCOPE_STORE
138+
)
137139
);
138140
$opacity = $this->scopeConfig->getValue(
139141
"design/watermark/{$type}_imageOpacity",
@@ -145,8 +147,8 @@ private function getWatermark(string $type, int $scopeId = null): array
145147
ScopeInterface::SCOPE_STORE,
146148
$scopeId
147149
);
148-
$width = !empty($size['width']) ? $size['width'] : null;
149-
$height = !empty($size['height']) ? $size['height'] : null;
150+
$width = !empty($size['0']) ? $size['0'] : null;
151+
$height = !empty($size['1']) ? $size['1'] : null;
150152

151153
return [
152154
'watermark_file' => $file,

0 commit comments

Comments
 (0)