diff --git a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php index c11f42a18964c..39222e43cd935 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/Gd2.php +++ b/lib/internal/Magento/Framework/Image/Adapter/Gd2.php @@ -63,6 +63,16 @@ public function open($filename) } $this->imageDestroy(); $this->_imageHandler = call_user_func($this->_getCallback('create'), $this->_fileName); + $fileType = $this->getImageType(); + if (in_array($fileType, [IMAGETYPE_PNG, IMAGETYPE_GIF])) { + $this->_keepTransparency = true; + if ($this->_imageHandler) { + $isAlpha = $this->checkAlpha($this->_fileName); + if ($isAlpha) { + $this->_fillBackgroundColor($this->_imageHandler); + } + } + } } /**