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 Jerry Stuckle on 11/04/06 04:36

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).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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