Browse Source

Transparency fix for thumbnails

tags/v0.9
Savetheinternet 13 years ago
parent
commit
d1d6429421
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      inc/functions.php

+ 8
- 4
inc/functions.php View File

@@ -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);


Loading…
Cancel
Save