10-03-2005, 06:34
|
|
|
|
חבר מתאריך: 07.10.04
הודעות: 373
|
|
בעיה : thumbs with gd
כאשר אני מנסה ליצור תמונה ממוזערת באמצעות gd (כלומר להקטין תמונות בפרופורציה כלשהי באמצעות gd) אני מצליח, אך כאשר אני נאלץ להציג מספר תמונות (כ15), חלקם לא מוצגים ובריפרוש הם חוזרים או מציגים לי שגיאה כללית לדף (שגיאת Forbidden).
thumb.gd :
קוד PHP:
<? Header("Content-type: image/jpeg");
$im = $_GET['im'];
if(!getimagesize($im)) $im = 'error.jpg';
$orig_image = imagecreatefromjpeg($im); list($width, $height, $type, $attr) = getimagesize($im);
$s = '1'; $num = '360'; if ($width > 360) { $ratio = 360 / $width; $newheight = $ratio * $height; } else $newheight = $height;
$sm_image = imagecreatetruecolor($num,$newheight) or die ("Cannot Initialize new gd image stream");; Imagecopyresampled($sm_image,$orig_image,0,0,0,0,$ num,$newheight,imagesx($orig_image),imagesy($orig_ image));
imageJPEG($sm_image); imagedestroy($sm_image); imageDestroy($orig_image);
?>
|