Commit 6bd0ced7 authored by Avris's avatar Avris

fix transparency handling

parent 3114ea6e
......@@ -331,6 +331,8 @@ final class Esse extends AbstractExtension
}
[$targetWidth, $targetHeight] = $newSize;
imagealphablending($img, true);
imagesavealpha($img, true);
$newImg = $this->resizeImage($img, $width, $height, $targetWidth, $targetHeight);
switch ($outputType) {
......@@ -379,6 +381,8 @@ final class Esse extends AbstractExtension
private function resizeImage($img, int $originalWidth, int $originalHeight, int $targetWidth, int $targetHeight)
{
$newImg = imagecreatetruecolor($targetWidth, $targetHeight);
imagealphablending($newImg, false);
imagesavealpha($newImg, true);
imagecopyresampled($newImg, $img, 0, 0, 0, 0, $targetWidth, $targetHeight, $originalWidth, $originalHeight);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment