Allora io ho fatto come hai detto tu cambiando solo il parametro passato:
Codice PHP:
[img]thumb.php?id=<?php echo [/img] />"
e poi nel file thumb.php ho messo:
Codice PHP:
<?php
$image = $_GET['src'];
header("Content-type: image/jpeg"); // Cambia in base al tipo di file
// Possono anche essere passati tramite GET
$max_width = 100;
$max_height = 100;
//*****************************************
$info = getimagesize($image);
$width = $info[0];
$height = $info[1];
// Calcolo le nuove dimensioni
if($width > $max_width)
{
$width = $max_width;
$height = ceil($width * $info[1] / $info[0]);
}
if($new_height > $max_height)
{
$height = $max_height;
$width = ceil($height * $info[0] / $info[1]);
}
//*****************************************
$thumb = imagecreatefromjpeg($image); // Varia per ogni estensione
$newsize = imagecreatetruecolor($width, $height);
imagecopyresampled($newsize, $thumb, 0, 0, 0, 0, $width, $height, imagesx($thumb),imagesy($thumb));
imagejpeg($newsize, '', 100);
imagedestroy($thumb);
?>
Ma non mi visualizza l'immagine... perchè?