summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-11-03 00:08:03 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2010-11-03 00:08:03 +1100
commitd1d6429421a7f866cb7fd7f4c750ead92c295b85 (patch)
tree10bd7a09ec5aadfed26283914c06a3913cadc50e
parent80099c87e6f2acd5c5397e5c8a25ad4916d8a1ca (diff)
Transparency fix for thumbnails
-rw-r--r--inc/functions.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/inc/functions.php b/inc/functions.php
index c672f2b3..911c1bc4 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -350,10 +350,14 @@
$return['width'] = $tn_width;
$return['height'] = $tn_height;
- $tmp=imagecreatetruecolor($tn_width, $tn_height);
- imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height,$width,$height);
-
- imagepng($tmp, $destination_pic, 100);
+ $tmp = imagecreatetruecolor($tn_width, $tn_height);
+ imagecolortransparent($tmp, imagecolorallocatealpha($tmp, 0, 0, 0, 0));
+ imagealphablending($tmp, false);
+ imagesavealpha($tmp, true);
+
+ imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width, $height);
+
+ imagepng($tmp, $destination_pic, 4);
imagedestroy($src);
imagedestroy($tmp);