We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adfcc62 commit f4ec74aCopy full SHA for f4ec74a
src/PhpWord/Element/Image.php
@@ -335,6 +335,10 @@ public function getImageStringData($base64 = false)
335
// Read image binary data and convert to hex/base64 string
336
if ($this->sourceType == self::SOURCE_GD) {
337
$imageResource = call_user_func($this->imageCreateFunc, $actualSource);
338
+ if ($this->imageType === 'image/png') {
339
+ // PNG images need to preserve alpha channel information
340
+ imagesavealpha($imageResource, true);
341
+ }
342
ob_start();
343
call_user_func($this->imageFunc, $imageResource);
344
$imageBinary = ob_get_contents();
0 commit comments