imagesavealpha() in Element\Image
This commit is contained in:
parent
adfcc62e64
commit
f4ec74a4c5
|
|
@ -335,6 +335,10 @@ class Image extends AbstractElement
|
|||
// Read image binary data and convert to hex/base64 string
|
||||
if ($this->sourceType == self::SOURCE_GD) {
|
||||
$imageResource = call_user_func($this->imageCreateFunc, $actualSource);
|
||||
if ($this->imageType === 'image/png') {
|
||||
// PNG images need to preserve alpha channel information
|
||||
imagesavealpha($imageResource, true);
|
||||
}
|
||||
ob_start();
|
||||
call_user_func($this->imageFunc, $imageResource);
|
||||
$imageBinary = ob_get_contents();
|
||||
|
|
|
|||
Loading…
Reference in New Issue