note 36279 added to function.imagejpeg
| From: | _francis at usa dot com | Date: | Fri, 03 Oct 2003 08:32:43 +0000 |
| Subject: | note 36279 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-57666@lists.php.net to get a copy of this message | ||
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 doesn
t 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();
?>
----
Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36279
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36279&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36279&report=yes