Skip to content

Commit ae9e540

Browse files
authored
Merge pull request #557 from magento-performance/MAGETWO-60039
[Peformance] MAGETWO-60039: Resize images mechanism is broken on frontend
2 parents 2adb6e2 + 812954e commit ae9e540

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,7 @@ public function setBaseFile($file)
498498
$path = [
499499
$this->_catalogProductMediaConfig->getBaseMediaPath(),
500500
'cache',
501-
$this->_storeManager->getStore()->getId(),
502-
$path[] = $this->getDestinationSubdir(),
501+
$this->getDestinationSubdir(),
503502
];
504503
if (!empty($this->_width) || !empty($this->_height)) {
505504
$path[] = "{$this->_width}x{$this->_height}";

app/code/Magento/Catalog/Test/Unit/Model/Product/ImageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function testSetGetBaseFile()
180180
$this->image->setBaseFile('/somefile.png');
181181
$this->assertEquals('catalog/product/somefile.png', $this->image->getBaseFile());
182182
$this->assertEquals(
183-
'catalog/product/cache/1//beff4985b56e3afdbeabfc89641a4582/somefile.png',
183+
'catalog/product/cache//beff4985b56e3afdbeabfc89641a4582/somefile.png',
184184
$this->image->getNewFile()
185185
);
186186
}
@@ -302,7 +302,7 @@ public function testGetUrl()
302302
$this->testSetGetBaseFile();
303303
$url = $this->image->getUrl();
304304
$this->assertEquals(
305-
'http://magento.com/media/catalog/product/cache/1//beff4985b56e3afdbeabfc89641a4582/somefile.png',
305+
'http://magento.com/media/catalog/product/cache//beff4985b56e3afdbeabfc89641a4582/somefile.png',
306306
$url
307307
);
308308
}

0 commit comments

Comments
 (0)