GD-lib, imagecreatefromgif
jeg får en fejl i imagecreatefromgif() ??men hvis billedet er jpg er der ingen problemer...
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'].'.jpg';
$logo = $_SERVER["DOCUMENT_ROOT"].str_replace('user/'.basename($_SERVER["PHP_SELF"]), '', $_SERVER["PHP_SELF"]).'pic_logo.png';
$quality = 100;
if($_GET['pic_ext'] == 'jpg') $src_pic = imagecreatefromjpeg($pic);
else $src_pic = imagecreatefromgif($pic);
$src_width = imagesx($src_pic);
$src_height = imagesy($src_pic);
$src_logo = imagecreatefrompng($logo);
$src_logo_width = imagesx($src_logo);
$src_logo_height = imagesy($src_logo);
$dst_pic = imagecreatetruecolor($src_width, $src_height);
imagecopyresampled($dst_pic, $src_pic, 0, 0, 0, 0, $src_width, $src_height, $src_width, $src_height);
$logo_x = $src_width - $src_logo_width;
$logo_y = $src_height - $src_logo_height;
imagecopyresampled($dst_pic, $src_logo, $logo_x, $logo_y, 0, 0, $src_width, $src_height, $src_width, $src_height);
imagejpeg($dst_pic, '', $quality);
imagedestroy($src_pic);
imagedestroy($src_logo);
imagedestroy($dst_pic);
