Skip to content

Commit

Permalink
[impr-OpenMage#1078] Prevent image resize to 0 width or height
Browse files Browse the repository at this point in the history
  • Loading branch information
wexo-team authored and edannenberg committed Aug 24, 2020
1 parent 590a621 commit 330cfa1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ public function resizeFile($source, $keepRation = true)
$image->open($source);
$width = $this->getConfigData('resize_width');
$height = $this->getConfigData('resize_height');

if ($width == 0 || $height == 0) {
return false;
}

$image->keepAspectRatio($keepRation);
$image->resize($width, $height);
$dest = $targetDir
Expand Down

0 comments on commit 330cfa1

Please sign in to comment.