Skip to content

Commit

Permalink
Fixing the black background filling
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard13 committed Aug 12, 2018
1 parent bc697d9 commit bfeba59
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/internal/Magento/Framework/Image/Adapter/Gd2.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ class Gd2 extends \Magento\Framework\Image\Adapter\AbstractAdapter
*/
const KEEP_TRANSPARENCY = true;

/**
* Mime Type for png images
*/
const PNG_MIME_TYPE = 'image/png';

/**
* Required extensions
*
Expand Down Expand Up @@ -81,7 +76,10 @@ public function open($filename)
if (in_array($fileType, [IMAGETYPE_PNG, IMAGETYPE_GIF])) {
$this->_keepTransparency = self::KEEP_TRANSPARENCY;
if ($this->_imageHandler) {
$this->_fillBackgroundColor($this->_imageHandler);
$isAlpha = $this->checkAlpha($this->_fileName);
if ($isAlpha) {
$this->_fillBackgroundColor($this->_imageHandler);
}
}
}
}
Expand Down

0 comments on commit bfeba59

Please sign in to comment.