ciao raga...ho un problema con questo script x ridimensionare l'immagine caricata...
Codice PHP:
<?php
include("config.php");
include("core.php");
connectdb();
$pic = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_gallery WHERE id ='".$id."'"));
if($pic[3]!='')
{
$filename = "$pic[3]";
}
else
{
$filename = "../images/nopic.jpg";
}
$height= 150;
$width= 150;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, null, 100);
ImageDestroy ($image_p);
?>
sapete dirmi l'errore???
a me non apre la visualizzazione dell'immagine...ridimensionata...
grazie a chi mi aiuterà