Ho questa funzione per le thumb.
Che funziona correttamente in locale,ma non va in remoto.
Dal phpinfo risulta la stessa versione sia di php che di gd...sapreste darmi una spiegazione?
grazie in anticipoCodice PHP:function createthumb($name,$filename){
$system=explode('.',$name);
if (preg_match('/jpg|jpeg/',$system[1])){
$src_img=imagecreatefromjpeg($name);
}
if (preg_match('/png/',$system[1])){
$src_img=imagecreatefrompng($name);
}
if (preg_match('/gif/',$system[1])){
$src_img=imagecreatefromgif($name);
}
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
$new_w="100";
$new_h=($old_y*$new_w)/$old_x;
$dst_img=imagecreatetruecolor($new_w,$new_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$old_x,$old_y);
if (preg_match("/png/",$system[1])){imagepng($dst_img,$filename);}
elseif (preg_match("/jpg|jpeg/",$system[1])){imagejpeg($dst_img,$filename);}
else {imagegif($dst_img,$filename);}
imagedestroy($dst_img);
imagedestroy($src_img);
}

Rispondi quotando
