Re: GD problem
| From: | (Richard Lynch) | Date: | Fri, 09 Jun 2000 19:38:38 +0000 |
| Subject: | Re: GD problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1416@lists.php.net to get a copy of this message | ||
In article <8hqlsj$a88$1@toye.php.net>, zeenox@online.no ("Nils Magnus
Eide Englund") wrote:
> When i try to output JPEG files in my PHP file, it outputs a BMP file!
> I use IE 5.0 to view the pages, but the server is running Mandrake 7.0
> with Apache 1.3.12 and PHP4. Here's an short version of my source:
>
> Header("Content-type: image/jpeg");
> $image = ImageCreate(300,300);
> # In this part I edit the image, creates fancy lines and stuff =)
> ImageJpeg($image);
> ImageDestroy($image);
>
> When I try to save the image, it defaults to a .bmp extension, and it
> certainly is a BMP. (When I open it with other programs)
If you're on Windows, and you save it as .bmp, and then open it, most
software is going to read the JPEG, convert it to a bmp, and show you that
it's a bmp.
Try naming the resulting file as .jpg and see what happens.
There are headers other than Content-type that you'll need to use to
convince your computer that it's a jpeg. Content-disposition, etc.
Check the archives.
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)