note 36279 rejected from function.imagejpeg by didou

From: Date: Fri, 03 Oct 2003 08:35:40 +0000
Subject: note 36279 rejected from function.imagejpeg by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57667@lists.php.net to get a copy of this message
Note Submitter: _francis@usa.com ---- hi i`m having a problem using the images in the HTML, when i call the php direct on the browser it works, but if i use a <img src="thum.php?img=<?= urlencode("./images/surfing.jpg")?>"> it doesnt work. if i right click in ie and select show image it shows it, but it doesnt do it on load. even tried preloading in javascript but didnt work. i used getimagesize just to make sure i had the correct headers. if anyone can help i would be greatful francis <? ob_start(); $img=stripslashes(urldecode($_GET['img'])); $img_src=imagecreatefromjpeg($img); $img_size=getimagesize($_GET['img']); $width=imagesx($img_src); $height=imagesy($img_src); $twidth=$width/3; $theight=$height/3; $img_dst=imagecreatetruecolor($twidth,$theight); imagecopyresized($img_dst, $img_src, 0, 0, 0, 0, $twidth, $theight, $width, $height); imagejpeg($img_dst, $g_dstfile, 60); imagedestroy($img_dst); header("Content-type: {$img_size['mime']}"); ob_flush(); ?>

« previous php.notes (#57667) next »