ciao a tutti!
uso questo script per fare il resize dinamico di immagini:
che vado a richiamare nelle mie pagine con un'istruzione del tipo:codice:$file=$_GET[file]; $hsize =$_GET['altezza']; $wsize =$_GET['larghezza']; $im_size = GetImageSize($file); $imageWidth = $im_size[0]; $imageHeight = $im_size[1]; $thumb_width = $wsize; $thumb_height = $hsize; $im2 = ImageCreateFromJPEG($file); if ($imageWidth>=$imageHeight) { $width = $thumb_width; $height = ($width/$imageWidth)*$imageHeight; } else { $height = $thumb_height; $width = ($height/$imageHeight)*$imageWidth; } $im = imageCreateTrueColor($width, $height); if (function_exists('ImageCopyResampled')) { ImageCopyResampled($im,$im2, 0, 0, 0, 0, $width, $height, $imageWidth, $imageHeight); } else { ImageCopyResized($im,$im2, 0, 0, 0, 0, $width, $height, $imageWidth, $imageHeight); } Header("Content-type: image/jpg"); Imagejpeg($im, '', 85); //85 è la qualità (da 1 a 100) ImageDestroy($im); ImageDestroy($im2);
il problema è ke online (aruba server apache2) funziona alla perfezione, in locale (apache) non funziona...qlc idea???codice:[img]resize.php?file=_36.jpg&altezza=480&larghezza=640[/img]

Rispondi quotando
