Einzelnen Beitrag anzeigen
  #2 (permalink)  
Alt 29-03-2005, 00:51
Raiser
 Newbie
Links : Onlinestatus : Raiser ist offline
Registriert seit: Jan 2004
Beiträge: 6
Raiser ist zur Zeit noch ein unbeschriebenes Blatt
Standard

PHP-Code:
<?php
$thumb
=imagecreatetruecolor($new_width,$new_height);
           switch(
$type):
                  case 
1:   $im=imagecreatefromgif($image);
                            
$info=gif_info($image);
                            
//echo $info['version'];
                            /* */
                            
if($info['version']=='89a' && $info['flag']==1)
                            {
                               
imagefilledrectangle($thumb,0,0,$new_width,$new_height,
(
imagecolorat($im,0,0)));
                               
//imagecolorallocate($im,$info['trans_red'],$info['trans_green'],$info['trans_blue'])
                               //hatte ich auch schon verwendet, da wird nur mit schwarz gefüllt
                            
}
                            break;
                  case 
2:   $im=imagecreatefromjpeg($image);
                            break;
                  case 
3:   $im=imagecreatefrompng($image);
                            break;
           endswitch;
           
imagecopyresized($thumb,$im,0,0,0,0,$new_width,$new_height,$width,$height);
           switch(
$type):
                  case 
1:   $info=gif_info($image);
                            if(
$info['version']=='89a' && $info['flag']==1)
                            {
                               
imagecolortransparent($thumb,
(
imagecolorallocate($im,$info['trans_red'],$info['trans_green'],$info['trans_blue'])));
                            }
                            
imagegif($thumb,$dest.'/thumb_'.$name);
                            break;
                  case 
2:   imagejpeg($thumb,$dest.'/thumb_'.$name);
                            break;
                  case 
3:   imagepng($thumb,$dest.'/thumb_'.$name);
                            break;
           endswitch;
        }
//--ende seitenrechnung
    
}//--ende funktion
}
?>
Mit Zitat antworten