diff options
-rw-r--r-- | fetch.php | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |