Hello,
I'm trying to display a very simple thing using GDlib...
imagepng doesn't work but imagejpeg does...
Link:
http://www.hpiracing.com/gdtest2.php
Code for imagepng:
$im = imagecreate ( 250, 100)
or die ("Cannot create a new GD image.");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
$text = "AAAAAAAAAAAAAaaaaaaaaaaaaaaaaaaargh!!!!";
$text2 = "WTF???";
imagestring ($im, 1, 5, 5, $text, $text_color );
imagestring($im, 1, 5, 15, $text2, $text_color );
imagestring($im, 1, 5, 25, "WHY DOESN'T THE PNG WORK???", $text_color);
header("Content-type: image/png");
imagepng ($im);
Code for imagejpeg (same code, different header, different function):
$im = imagecreate ( 250, 100)
or die ("Cannot create a new GD image.");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
$text = "AAAAAAAAAAAAAaaaaaaaaaaaaaaaaaaargh!!!!";
$text2 = "WTF???";
imagestring ($im, 1, 5, 5, $text, $text_color );
imagestring($im, 1, 5, 15, $text2, $text_color );
imagestring($im, 1, 5, 25, "WHY DOESN'T THE PNG WORK???", $text_color);
header("Content-type: image/jpeg");
imagejpeg ($im);
Any help with this would be great.