View Single Post
Old 06-04-2008, 07:42 PM   #2 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

For one thing, you're creating $source twice. And you may be able to forgo the imagealphablending() in favour of just using imagecopyresampled(). Try this after your switch statement?

PHP Code:
    $dimg imagecreatetruecolor($newwidth$newheight);
    
imagecopyresampled($dimg$source0000$newwidth$newheight$width$height);
    
$filename="$output_dir/test1.gif";
    if (
imagegif($dimg$filename)) {
        
imagedestroy($dimg);
        
imagedestroy($source);
        return 
true;
    } else {
        
imagedestroy($dimg);
        
imagedestroy($source);
        return 
false;
    } 
I would've rewritten the whole thing just to be sure, but I'm in the middle of cleaning my bedroom. Between my wife and the pets, it's hurricane katrina in there.
-m
delayedinsanity is offline  
Reply With Quote