Re: [PHP] libpng error
Thank you very much, really appreciate it. But I have to admit that I an example from a book in which he creates a gif (and not a png), where he doesn't actually have to allocate a color. He only has 3 lines which are supposed to work. Maybe true for gif, but cannot tell, since I don't have gif support. header("Content-type: image/gif"); $image= imagecreate(200,200)l imageRectangle($image, 50, 50, 150, 150, $blue); regards, thalis -- No excellent soul is exempt from a mixture of madness. -- Aristotle On Mon, 2 Apr 2001, nicuc.ac.jp wrote: 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"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Helloppl, I have php compiled with GD support (version1.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] libpng error
On Mon, 2 Apr 2001, Thalis A. Kalfigopoulos wrote: Thank you very much, really appreciate it. But I have to admit that I have an example from a book in which he creates a gif (and not a png), where he doesn't actually have to allocate a color. He only has 3 lines which are supposed to work. Maybe true for gif, but cannot tell, since I don't have gif support. header("Content-type: image/gif"); $image= imagecreate(200,200)l imageRectangle($image, 50, 50, 150, 150, $blue); Sorry mistake. 3-line code of example was: header("Content-type: image/gif"); $image= imagecreate(200,200); imagegif($image); cheers, thalis 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- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] libpng error
Not test your code with GIF yet (I not have GIF support). In your book they have a result picture of this code ? I try this by change imagegif($image) to imagepng($image) and return blank image with specify width. -- -Tuna- ""Thalis A. Kalfigopoulos"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Mon, 2 Apr 2001, Thalis A. Kalfigopoulos wrote: Thank you very much, really appreciate it. But I have to admit that I have an example from a book in which he creates a gif (and not a png), where he doesn't actually have to allocate a color. He only has 3 lines which are supposed to work. Maybe true for gif, but cannot tell, since I don't have gif support. header("Content-type: image/gif"); $image= imagecreate(200,200)l imageRectangle($image, 50, 50, 150, 150, $blue); Sorry mistake. 3-line code of example was: header("Content-type: image/gif"); $image= imagecreate(200,200); imagegif($image); cheers, thalis 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- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] libpng error
Helloppl, I have php compiled with GD support (version1.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] libpng error
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"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Helloppl, I have php compiled with GD support (version1.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]