Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/05/2008, 16:48
p2pdownloading
Invitado
 
Mensajes: n/a
Puntos:
como hacer para que este codigo hacepte .png y .gif

hola me gustaria saber como hacer para que este codigo que genera thumnails me hacepte formatos como png y gif y por otro lado no me pixele las imagenes, aqui adjunto un ejemplo...




saludos y gracias

Código PHP:
$thumb_dir "uploads/thumbnails"// No trailing slash
    
$sShot_explode explode("screenshots/"$sShot);
    
$filename $sShot_explode[1];
    
    
$src ImageCreateFromJPEG($sShot); 

        
$filesize filesize($sShot); 
        
$org_h imagesy($src); 
        
$org_w imagesx($src); 

        
$height $thumb_height
        
$width $thumb_width
     
         
$img ImageCreate($width,$height); 

         
ImageCopyResized($img$src0000$width$height$org_w$org_h); 

         
ImageJPEG($img$thumb_dir."/".time()."thumb_".$filename75);
         
$thumb $thumb_dir."/".time()."thumb_".$filename;
      
         
ImageDestroy ($img);
         
ImageDestroy ($src);