Commit 30323610 authored by Dries's avatar Dries
Browse files

- Patch #59263 by stefan et al: bugfix, support PNGs with alpha layer.

parent bf41b22c
......@@ -223,6 +223,13 @@ function image_gd_resize($source, $destination, $width, $height) {
}
$res = imageCreateTrueColor($width, $height);
if ($info['extension'] == 'png') {
$transparency = imagecolorallocatealpha($res, 0, 0, 0, 127);
imagealphablending($res, FALSE);
imagefilledrectangle($res, 0, 0, $width, $height, $transparency);
imagealphablending($res, TRUE);
imagesavealpha($res, TRUE);
}
imageCopyResampled($res, $im, 0, 0, 0, 0, $width, $height, $info['width'], $info['height']);
$result = image_gd_close($res, $destination, $info['extension']);
......
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