Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 52377b5

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.1-develop
Accepted Public Pull Requests: - magento/magento2#17855: [Backport] Fixes black background for png images in wysiwyg editors. (by @eduard13) - magento/magento2#17774: Fix for ProductLink - setterName was incorrectly being set (by @insanityinside) Fixed GitHub Issues: - magento/magento2#14248: Transparent background becomes black for thumbnails of PNG into Wysiwyg editor... (reported by @jb-dg) has been fixed in magento/magento2#17855 by @eduard13 in 2.1-develop branch Related commits: 1. 99eb521
2 parents 310c884 + 2cca27d commit 52377b5

File tree

2 files changed

+11
-1
lines changed
  • lib/internal/Magento/Framework/Image/Adapter

2 files changed

+11
-1
lines changed

app/code/Magento/Catalog/Model/ProductLink/Repository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function getList(\Magento\Catalog\Api\Data\ProductInterface $product)
178178
foreach ($item['custom_attributes'] as $option) {
179179
$name = $option['attribute_code'];
180180
$value = $option['value'];
181-
$setterName = 'set'.ucfirst($name);
181+
$setterName = 'set'.str_replace('_', '', ucwords($name, '_'));
182182
// Check if setter exists
183183
if (method_exists($productLinkExtension, $setterName)) {
184184
call_user_func([$productLinkExtension, $setterName], $value);

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)