gd-lib fejl
jeg har streamer nogle billeder som thumbs, men oplever at der er et billede den ikke kan generere??http://clark.avansis.dk/test/test.php
her er min kode til billederne:
<?
if($_GET['pic_ext'] == 'jpg') header("content-type: image/jpeg");
else header("content-type: image/gif");
$pic = $_SERVER["DOCUMENT_ROOT"].str_replace(basename($_SERVER["PHP_SELF"]), '', $_SERVER["PHP_SELF"]).$_GET['id'].'.'.$_GET['pic_ext'];
$quality = 75;
$width = 112;
$height = 112;
if($_GET['pic_ext'] == 'jpg') $src_pic = imagecreatefromjpeg($pic);
else $src_pic = imagecreatefromgif($pic);
$src_width = imagesx($src_pic);
$src_height = imagesy($src_pic);
$scale = ($src_height / $height);
$dst_width = ($src_width / $scale);
$dst_height = ($src_height / $scale);
if($width < $dst_width)
{
$scale = ($dst_width / $width);
$dst_width = ($dst_width / $scale);
$dst_height = ($dst_height / $scale);
}
$dst_pic = imagecreatetruecolor($dst_width, $dst_height);
imagecopyresampled($dst_pic, $src_pic, 0, 0, 0, 0, $dst_width, $dst_height, $src_width, $src_height);
imagejpeg($dst_pic, '', $quality);
imagedestroy($src_pic);
imagedestroy($dst_pic);
?>
