1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-02 18:32:56 +02:00

Update Encoder.php

This commit is contained in:
thomas4Bitcraft
2020-04-01 22:10:53 +02:00
committed by GitHub
parent a59085a161
commit 509f5a3023

View File

@@ -66,6 +66,9 @@ class Encoder extends \Intervention\Image\AbstractEncoder
}
ob_start();
imagepalettetotruecolor($this->image->getCore());
imagealphablending($this->image->getCore(), true);
imagesavealpha($this->image->getCore(), true);
imagewebp($this->image->getCore(), null, $this->quality);
$this->image->mime = defined('IMAGETYPE_WEBP') ? image_type_to_mime_type(IMAGETYPE_WEBP) : 'image/webp';
$buffer = ob_get_contents();