Skip to content

Commit 96e4096

Browse files
ENGCOM-2898: [Backport] Fixes black background for png images in wysiwyg editors. #17855
- Merge Pull Request #17855 from eduard13/magento2:2.1-develop-bp-16733 - Merged commits: 1. 99eb521
2 parents 310c884 + 99eb521 commit 96e4096

File tree

1 file changed

+10
-0
lines changed
  • lib/internal/Magento/Framework/Image/Adapter

1 file changed

+10
-0
lines changed

lib/internal/Magento/Framework/Image/Adapter/Gd2.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ public function open($filename)
6363
}
6464
$this->imageDestroy();
6565
$this->_imageHandler = call_user_func($this->_getCallback('create'), $this->_fileName);
66+
$fileType = $this->getImageType();
67+
if (in_array($fileType, [IMAGETYPE_PNG, IMAGETYPE_GIF])) {
68+
$this->_keepTransparency = true;
69+
if ($this->_imageHandler) {
70+
$isAlpha = $this->checkAlpha($this->_fileName);
71+
if ($isAlpha) {
72+
$this->_fillBackgroundColor($this->_imageHandler);
73+
}
74+
}
75+
}
6676
}
6777

6878
/**

0 commit comments

Comments
 (0)