Skip to content

Commit 816b750

Browse files
committed
MAGETWO-89051: Absorb image optimization from 2.1 into 2.3
1 parent a289250 commit 816b750

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ public function getResizedImageInfo()
814814
$image = $this->imageAsset->getPath();
815815
}
816816

817-
$imageProperties = $this->getimagesize($image);
817+
$imageProperties = $this->getImageSize($image);
818818

819819
return $imageProperties;
820820
} finally {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private function getWatermark(string $type): array
137137
ScopeInterface::SCOPE_STORE
138138
);
139139
$width = !empty($size['width']) ? $size['width'] : null;
140-
$height = !empty($size['width']) ? $size['height'] : null;
140+
$height = !empty($size['height']) ? $size['height'] : null;
141141

142142
return [
143143
'watermark_file' => $file,

app/code/Magento/Catalog/Model/View/Asset/Image.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function getModule()
171171
private function getMiscPath()
172172
{
173173
return $this->encryptor->hash(
174-
implode('_', $this->convertTotoReadableFormat($this->miscParams)),
174+
implode('_', $this->convertToReadableFormat($this->miscParams)),
175175
Encryptor::HASH_VERSION_MD5
176176
);
177177
}
@@ -194,7 +194,7 @@ private function getImageInfo()
194194
* @param $miscParams
195195
* @return array
196196
*/
197-
private function convertTotoReadableFormat($miscParams)
197+
private function convertToReadableFormat($miscParams)
198198
{
199199
$miscParams['image_height'] = 'h:' . ($miscParams['image_height'] ?? 'empty');
200200
$miscParams['image_width'] = 'w:' . ($miscParams['image_width'] ?? 'empty');

app/code/Magento/MediaStorage/App/Media.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class Media implements AppInterface
8282
* @var State
8383
*/
8484
private $appState;
85+
8586
/**
8687
* @var ImageResize
8788
*/

app/code/Magento/MediaStorage/Service/ImageResize.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,12 @@ public function resizeFromImageName(string $originalImageName)
148148
*/
149149
public function resizeFromThemes(array $themes = null): \Generator
150150
{
151-
$productImages = $this->productImage->getAllProductImages();
152-
153151
$count = $this->productImage->getCountAllProductImages();
154152
if (!$count) {
155153
throw new NotFoundException(__('Cannot resize images - product images not found'));
156154
}
157155

156+
$productImages = $this->productImage->getAllProductImages();
158157
$viewImages = $this->getViewImages($themes ?? $this->getThemesInUse());
159158

160159
foreach ($productImages as $image) {

0 commit comments

Comments
 (0)