transparent image thumbnails have white background instead of black

This commit is contained in:
mappu 2013-11-09 13:36:24 +13:00
parent 80d95d09f9
commit a78cf9f6bb

View File

@ -29,6 +29,7 @@ function mkthumbnail($src_file, $dest_file, $width, $height) {
$im = imagecreatefromstring(file_get_contents($src_file));
$dest = imagecreatetruecolor($width, $height);
imagefilledrectangle($dest, 0, 0, $width, $height, imagecolorallocate($dest, 0xFF, 0xFF, 0xFF));
$scale = max( $width/$src_width, $height/$src_height ); // overscale + crop