Skip to content
Snippets Groups Projects
Commit f54a290c authored by andi's avatar andi
Browse files

alphachannel saving for PNG resizing

darcs-hash:20050416120037-9977f-e7c116a8841d4c908e58b1bb034616afa523ac73.gz
parent 97a3e4e3
No related branches found
No related tags found
No related merge requests found
......@@ -172,6 +172,7 @@ function resize_image($ext,$from,$from_w,$from_h,$to,$to_w,$to_h){
}elseif($ext == 'png') {
if(!function_exists("imagecreatefrompng")) return false;
$image = @imagecreatefrompng($from);
}elseif($ext == 'gif') {
if(!function_exists("imagecreatefromgif")) return false;
$image = @imagecreatefromgif($from);
......@@ -184,6 +185,12 @@ function resize_image($ext,$from,$from_w,$from_h,$to,$to_w,$to_h){
if(!$newimg) $newimg = @imagecreate($to_w, $to_h);
if(!$newimg) return false;
//keep png alpha channel if possible
if($ext == 'png' && $conf['gdlib']>1 && function_exists('imagesavealpha')){
imagealphablending($newimg, false);
imagesavealpha($newimg,true);
}
// create cachedir
io_makeFileDir($to);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment