Re: imagecopyresized() problems
| From: | Richard Lynch | Date: | Tue, 09 Jul 2002 21:57:46 +0000 |
| Subject: | Re: imagecopyresized() problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-106619@lists.php.net to get a copy of this message | ||
>I am trying to create a piece of code that will create and display
>thumbnail image. When trying to send the image to a browser, I see
>binary data rather then an image. You can see the problem at
>www.dallypost.com/a/test.php
>
>The troubled cose for this page follows:
>
><?PHP
> print("<img src = $master_image_all_link>");
You can't have the IMG tag and the actual image output in the same script.
Put the IMG tag into an HTML file, and the image output into a JPEG file.
The JPEG file can't output *anything* except headers and image data.
Speaking of headers:
> imagejpeg($dst_img, '', 50);//sends the image to the browser
Right *BEFORE* this line, you need to do:
header("Content-type: image/jpeg");
Otherwise, the browser doesn't know it's a JPEG and has to guess. It might
guess right. It might not.
--
Like Music? http://l-i-e.com/artists.htm