Skip to content

Commit

Permalink
Merge pull request #557 from magento-performance/MAGETWO-60039
Browse files Browse the repository at this point in the history
[Peformance] MAGETWO-60039: Resize images mechanism is broken on frontend
  • Loading branch information
balex13 authored Nov 3, 2016
2 parents 2adb6e2 + 812954e commit ae9e540
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/code/Magento/Catalog/Model/Product/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,7 @@ public function setBaseFile($file)
$path = [
$this->_catalogProductMediaConfig->getBaseMediaPath(),
'cache',
$this->_storeManager->getStore()->getId(),
$path[] = $this->getDestinationSubdir(),
$this->getDestinationSubdir(),
];
if (!empty($this->_width) || !empty($this->_height)) {
$path[] = "{$this->_width}x{$this->_height}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function testSetGetBaseFile()
$this->image->setBaseFile('/somefile.png');
$this->assertEquals('catalog/product/somefile.png', $this->image->getBaseFile());
$this->assertEquals(
'catalog/product/cache/1//beff4985b56e3afdbeabfc89641a4582/somefile.png',
'catalog/product/cache//beff4985b56e3afdbeabfc89641a4582/somefile.png',
$this->image->getNewFile()
);
}
Expand Down Expand Up @@ -302,7 +302,7 @@ public function testGetUrl()
$this->testSetGetBaseFile();
$url = $this->image->getUrl();
$this->assertEquals(
'http://magento.com/media/catalog/product/cache/1//beff4985b56e3afdbeabfc89641a4582/somefile.png',
'http://magento.com/media/catalog/product/cache//beff4985b56e3afdbeabfc89641a4582/somefile.png',
$url
);
}
Expand Down

0 comments on commit ae9e540

Please sign in to comment.