gd-lib fejl efter serverskift
HejJeg har idag skiftet server. Begge kører PHP/4.4.4
Jeg får en 404 efter serverskiftet ved nedenstående fil, men efter at jeg undlader de to escapede områder virker det fint!? Hvad kan der være galt?
<?
session_start();
require('../req/functions.php');
header('content-type: image/'.$_GET['pic_ext']);
$pic = './user/'.$_GET['id'].'.'.$_GET['pic_ext'];
$logo = './pic_logo.png';
$quality = 100;
$font_size = 10;
$font_stroke = 1;
if($_GET['pic_ext'] == 'jpeg') $src_pic = imagecreatefromjpeg($pic);
elseif($_GET['pic_ext'] == 'gif') $src_pic = imagecreatefromgif($pic);
elseif($_GET['pic_ext'] == 'png') $src_pic = imagecreatefrompng($pic);
$src_width = imagesx($src_pic);
$src_height = imagesy($src_pic);
$font_pos_x = 6;
$font_pos_y = $src_height - 8;
/*
$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);
$name = mysql_fetch_array(mysql_query("SELECT name FROM $DB.user WHERE id='".$_GET['id']."'"));
$blue = imagecolorallocate($dst_pic, 1, 32, 61);
for($ox = -$font_stroke; $ox <= $font_stroke; $ox++)
{
for($oy = -$font_stroke; $oy <= $font_stroke; $oy++) imagettftext($dst_pic, $font_size, 0, $font_pos_x+$ox, $font_pos_y+$oy, $blue, 'tahoma.ttf', $name['name']);
}
$white = imagecolorallocate($dst_pic, 238, 238, 238);
imagettftext($dst_pic, $font_size, 0, $font_pos_x, $font_pos_y, $white, 'tahoma.ttf', $name['name']);
/*
$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);
*/
if($_GET['pic_ext'] == 'jpeg') imagejpeg($dst_pic, '', $quality);
elseif($_GET['pic_ext'] == 'gif') imagegif($dst_pic, '', $quality);
elseif($_GET['pic_ext'] == 'png') imagepng($dst_pic, '', $quality);
imagedestroy($src_pic);
imagedestroy($src_logo);
imagedestroy($dst_pic);
?>
