Re: Re: outputing image part 2
| From: | Stut | Date: | Fri, 15 Jun 2007 21:11:05 +0000 |
| Subject: | Re: Re: outputing image part 2 | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257133@lists.php.net to get a copy of this message | ||
Ross wrote:
Thanks Stut we are getting somewhere. Removing the header gives the full binary output of the file in IE and FF. I also removes the echos and have the resized image showing in the browser. So far so good. I know it works. Now back to sending the URL. I have this $img_url="http://www.xxxxxxx.co.uk/images/ENbb24469/room1.JPG"; echo "<img src=\"common/display_image.php?img_url='$img_url'\" width=\"200\" height=\"100\" />"; and on the display image page I have: $img_url= $_GET['img_url']; $image = imagecreatefromjpeg($img_url); if ($image === false) { exit; } /// rest of the resize code goes here..... This still does not work but if I plug the url in manually at the top of display_image.php it works, this suggests it is not being sent properly.OK, your problem here is the single quotes in the img src around $img_url. However, I question what you are actually doing. Is the image on the same machine as this script? If so you should be using a filename not the URL. Also, are you sure you're really saving anything by resizing the image on your server like this? You should consider generating the smaller version using a cron job and linking to it directly. Resizing images on the fly is one of the quickest ways to destroy the scalability of a website. -Stut