Re: libpng error
| From: | nicuc.ac.jp | Date: | Mon, 02 Apr 2001 02:32:33 +0000 |
| Subject: | Re: libpng error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46543@lists.php.net to get a copy of this message | ||
Hello
I make change of your code by move some line to correct line and it's
work.
Here this a code
<?PHP
header("Content-type: image/png");
$image= imagecreate(200,200) or die("Failed in call to
imagecreate()<BR>\n");
$blue = imageColorAllocate($image,0,0,255);
imageRectangle($image, 50, 50, 150, 150, $blue);
imagepng($image); //---- I MOVE THIS LINE
imagedestroy($image);
?>
Hope this will help.
-Tuna-
""Thalis A. Kalfigopoulos"" <thalis@cs.pitt.edu> wrote in message
news:Pine.LNX.4.21.0104011819060.23359-100000@aluminum.cs.pitt.edu...
> Helloppl,
> I have php compiled with GD support (version>1.8 so I have png support). I
try the following code and get a broken image:
>
> <?php
> header("Content-type: image/png");
>
> $image= imagecreate(200,200) or die("Failed in call to
imagecreate()<BR>\n");
> imagepng($image);
> $blue = imageColorAllocate($image,0,0,255);
> imageRectangle($image, 50, 50, 150, 150, $blue);
>
> imagedestroy($image);
> ?>
>
> I get this error in the Apache error log (Apache with DSO support and php
as a .so):
> gd-png: fatal libpng error: Invalid number of colors in palette
> gd-png error: setjmp returns error condition
>
> Any ideas what's wrong?
>
> regards,
> thalis
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>