ciao a tutti.
il mio codice:
codice:
mysql_select_db($_GET['db']) or die("Selezione del database non riuscita");
$tabella=$_GET['tabella'];
$id=$_GET['id'];
$query="select image from $tabella where id=$id";
$result=mysql_query($query) or die("caricamento immagine non riuscito");
$oggetto=mysql_fetch_array($result);
mysql_close();
/*header("content-type: image/jpeg\n");
header('Pragma: no-cache');
header("Content-Transfer-Encoding: binary");
header("Content-length:10240 ");*/
$tmpimage=imagecreatefromstring($oggetto['image']);
if(isset($_GET['size'])){
//RIDIMENSIONO CON LE GD
$src_width=imagesx($tmpimage);
$src_height=imagesy($tmpimage);
$ratio=max($src_height,$src_width) / $_GET['size'];
$tmp_resized=imagecreatetruecolor($src_width / $ratio,$src_height / $ratio);
imagecopyresampled($tmp_resized, $tmpimage, 0, 0, 0, 0,
$src_width / $ratio,
$src_height / $ratio,
$src_width,
$src_height);
imagejpeg($tmp_resized);
imagedestroy($tmp_resized);
}else{
imagejpeg($tmpimage);
}
imagedestroy($tmpimage);
io vorrei sapere le dimensioni in byte delle immagini create con le gd? intendo dire: le dimensioni in byte di imagejpg($tmpimage);
e
imagejpeg($tmp_resized);
tenete conto che $oggetto['image'] è il campo blob.
grazie, sto impazzendo...