PDA

View Full Version : GD Libraries


Pokeguy
12-05-2000, 09:11 PM
Do i need to install gd libraries?? if not. how can i access them?
i have the following script to test, but it keeps giving me some header already sent message.
not sure what's wrong.
and i i take out the header info, it just gives me a blank screen.

anything to do with gd??

<HTML>
</BODY>
<?php
Header( &quot;Content-type: image/gif&quot;);
$image = imagecreate(200,200);
$maroon = ImageColorAllocate($image, 100, 0, 0);
$white = ImageColorAllocate($image, 255, 255, 255);
ImageFilledRectangle($image, 0, 0, 200, 200, $white);
?>
</HTML>
</BODY>

barrrt
12-05-2000, 09:20 PM
Try without html and body tags. Also make sure there are no spaces and newline characters outside of <? and ?>

Bart
:-)

Pokeguy
12-06-2000, 01:26 AM
i took out the html and body part

now all i see is a box with an X in it.

it knows to display a gif but its not showing a picture.

is this something with the gd libraries?

PaulKroll
12-06-2000, 05:29 AM
The image with an x is not a gif: it's the browser telling you that it's not seeing an image where it's supposed to. It's the &quot;Broken Graphic&quot; icon.

You need an &quot;ImageGIF($image);&quot; statement at the end, just before the ?>, so that PHP will actually tell the library to output the graphic.

Arthur
12-06-2000, 05:30 AM
You left out ImageGIF (Output image to browser or file).
On the last line insert this -
imagegif($image);

--
Arthur