forked from ConvertGroupsAS/magento2-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Patch-Magento_Catalog-image-frame-default-and-hash.patch
32 lines (30 loc) · 1.95 KB
/
Patch-Magento_Catalog-image-frame-default-and-hash.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- Helper/Image.php 2019-03-15 05:00:38.000000000 +0300
+++ Helper/Image.php 2019-09-13 18:31:38.828017728 +0300
@@ -212,9 +212,7 @@
// Set 'keep frame' flag
$frame = $this->getFrame();
- if (!empty($frame)) {
- $this->_getModel()->setKeepFrame($frame);
- }
+ $this->_getModel()->setKeepFrame($frame);
// Set 'constrain only' flag
$constrain = $this->getAttribute('constrain');
--- Model/View/Asset/Image.php 2019-03-15 05:00:38.000000000 +0300
+++ Model/View/Asset/Image.php 2019-09-13 18:47:20.269314350 +0300
@@ -200,11 +200,11 @@
$miscParams['image_width'] = 'w:' . ($miscParams['image_width'] ?? 'empty');
$miscParams['quality'] = 'q:' . ($miscParams['quality'] ?? 'empty');
$miscParams['angle'] = 'r:' . ($miscParams['angle'] ?? 'empty');
- $miscParams['keep_aspect_ratio'] = (isset($miscParams['keep_aspect_ratio']) ? '' : 'non') . 'proportional';
- $miscParams['keep_frame'] = (isset($miscParams['keep_frame']) ? '' : 'no') . 'frame';
- $miscParams['keep_transparency'] = (isset($miscParams['keep_transparency']) ? '' : 'no') . 'transparency';
- $miscParams['constrain_only'] = (isset($miscParams['constrain_only']) ? 'do' : 'not') . 'constrainonly';
- $miscParams['background'] = isset($miscParams['background'])
+ $miscParams['keep_aspect_ratio'] = (!empty($miscParams['keep_aspect_ratio']) ? '' : 'non') . 'proportional';
+ $miscParams['keep_frame'] = (!empty($miscParams['keep_frame']) ? '' : 'no') . 'frame';
+ $miscParams['keep_transparency'] = (!empty($miscParams['keep_transparency']) ? '' : 'no') . 'transparency';
+ $miscParams['constrain_only'] = (!empty($miscParams['constrain_only']) ? 'do' : 'not') . 'constrainonly';
+ $miscParams['background'] = !empty($miscParams['background'])
? 'rgb' . implode(',', $miscParams['background'])
: 'nobackground';
return $miscParams;