Skip to content

Commit

Permalink
Make PNG compression level configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Caprico85 committed Jun 22, 2021
1 parent 94563c7 commit 24251e7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/Varien/Image/Adapter/Gd2.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,7 @@ public function save($destination=null, $newName=null)
// set quality param for PNG file type
if (!is_null($this->quality()) && $this->_fileType == IMAGETYPE_PNG)
{
$quality = round(($this->quality() / 100) * 10);
if ($quality < 1) {
$quality = 1;
} elseif ($quality > 10) {
$quality = 10;
}
$quality = 10 - $quality;
$functionParameters[] = $quality;
$functionParameters[] = 9;
}

call_user_func_array($this->_getCallback('output'), $functionParameters);
Expand Down

0 comments on commit 24251e7

Please sign in to comment.