Salve a tutti,
Il seguente script, la cui funzione è quella di ridimensionare un immagine uplodata fia form dal sito, mi restituisce questo errore e non so x quale motivo.
chi sa aiutarmi?
ERRORE:
Fatal error: Call to undefined function: imagecreatetruecolor() in c:\programmi\easyphp1-8\www\not18122004\fun.inc.php on line 330
$pathartist="cartellaprova"; #creata da database - la modifico dopo.
$bigpath=$path."/".$pathartist;
$thumbspath=$path."/".$pathartist."/thumbs";
// controllo se esiste la dir artista altrimenti la crea
if (!file_exists($bigpath)){
@mkdir($bigpath);
@chmod ($bigpath,0777);
}
// controllo se esiste la dir Thumbs artista altrimenti la crea
if (!file_exists($thumbspath)){
@mkdir($thumbspath);
@chmod ($thumbspath,0777);
}
// prelevo le informazioni dal modulo
$tempfile = $_FILES['uploadfile']['tmp_name'];
$tempnomefile = $_FILES['uploadfile']['name'];
$dimbyte = $_FILES['uploadfile']['size'];
$Xtipo = $_FILES['uploadfile']['type'];
$titolo = $_REQUEST['TITOLO'];
list($org_width, $org_height, $tipo) = getimagesize($tempfile);
// creo il file e le miniature
$nomefile="0.".$tempnomefile;
echo "$nomefile - $org_width, $org_height";
echo " - $Xtipo $tipo -";
$final_bigpath=$bigpath."/".$nomefile;
// Set a maximum height and width
$B_width = 400;
// SET JPG
// imposto la nuova dimensione per il file grande
if ($B_width <= $org_width) {
$B_height = ($B_width / $org_width) * $org_height;
} else {
$B_width = $org_width;
$B_height = $org_height;
}
echo " ".$org_width."X".$B_height." $final_bigpath";
echo "$nomefile - $org_width";
// elaboro l'immagine
riga incriminata-> $image_j = imagecreatetruecolor($B_width, $B_height);
$B_image = imagecreatefromjpeg($nomefile);
imagecopyresampled($image_j, $B_image, 0, 0, 0, 0, $B_width, $B_height, $org_width, $org_height);
// selezionio il tipo di output
switch($tipo)
{
case "2":
imagejpeg($image_j, null, 100);
break;
case "1";
imagegif($image_j, null);
break;
case "3":
imagegif($image_j, null);
break;
}
copy($tempfile,$final_bigpath) or die("Il file $tempfile non è stato copiato con successo $final_bigpath");
// inserisco i dati nel database