summaryrefslogtreecommitdiff
path: root/includes/image.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/image.inc')
-rw-r--r--includes/image.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/image.inc b/includes/image.inc
index 37f377c1a..93622f509 100644
--- a/includes/image.inc
+++ b/includes/image.inc
@@ -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']);