You are here: Re: IE won't display gif created by GD threw php. « PHP Programming Language « IT news, forums, messages
Re: IE won't display gif created by GD threw php.

Posted by Ryan Knopp on 11/04/06 04:43

Jerry Stuckle wrote:
> Ryan Knopp wrote:
>> So if I create a gif image using the source below the image won't
>> display at all in IE. I just get a red X. It displays right with
>> Firefox and it also displays okay if i open it up in Paint or *name
>> your image software here*. Why won't it display in IE? Is there
>> something I need to do special to make it work?
>>
>>
>> #!/usr/bin/php
>> <?
>>
>> $DOTS = 5000;
>> $WIDTH = 6300;
>> $HEIGHT = 6300;
>>
>> $im = imagecreatetruecolor($WIDTH, $HEIGHT);
>>
>> for($i = 0; $i < $DOTS; ++$i){
>> imagesetpixel($im , rand(1, $WIDTH - 1), rand(1, $HEIGHT - 1),
>> imagecolorallocate($im, 250, 250, 250));
>> }
>>
>> imagegif($im, "../public_html/map.gif");
>> imagedestroy($im);
>>
>> ?>
>>
>>
>
> You haven't told the browser what this is. You need to set the content
> type, i.e.
>
> header("Content-Type: image/gif");
>
> Also, the shebang is not needed when running under a web browser - and
> in fact can cause problems (it will get sent to the browser).
>

I'm writing this gif out to a file where it get access from the browser.
It's not getting created on the fly during the browser call. Why would
I need a header? Wouldn't apache or do that for me? If i put a gif or
any file in a directory i can access it without the header command. Or
am i wrong?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация