Hay alguna forma para que este código php acepte .gif para hacer una firma (o avatar) dinámica? Solo me deja con .jpg o .png:
http://usuarios.lycos.es/eolx1/neogaf.php
Es que no tengo ni idea si seria posible.
<?
$font="./h.TTF";
/* So */
$dir="./firmas/"; //t
$types=array('jpg'=>'jpeg','jpeg'=>'jpeg','pjpeg'=>'jpeg','png'=>'png');
$dh=opendir($dir);
while($data=readdir($dh)){
if($data=='..' || $data=='.' || is_dir($dir.$data))
continue;
$temp_ext=explode('.',strrev($data),2);
$temp_ext=strrev($temp_ext[0]);
if($types[$temp_ext] || $_GET['debug'])
$sigs[]=$data;
}
mt_srand((double)microtime()*10000000);
$i=mt_rand(0,(count($sigs)-1));
$sig=$dir.$sigs[$i];
$ext=explode('.',strrev($sig),2);
$ext=strrev($ext[0]);
$type=$types[$ext];
if(!$type){
header('content-type: image/jpeg');
$im=imagecreate(500,100);
$white=imagecolorallocate($im,255,255,255);
$black=imagecolorallocate($im,0,0,0);
imagefill($im,0,0,$white);
imagettftext($im,13,0,0,10,$black,$dir.$font,'Extensión del archivo inaceptable'.$ext);
imagejpeg($im,'',100);
imagedestroy($im);
}else{
header("Content-Type: image/{$type}");
readfile($sig);
}
?>
El código está sacado de un tutorial de mundogamers
http://www.mundogamers.com/foros/thread13011.html