i wrote this basic codes to check against gd library existence:

$image = @imagecreate(480, 250) or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 0, 0, 0); 
$text_color  = imagecolorallocate ($im, 255, 0, 0); 
imagestring ($im, 255,255,0,  "A Simple Text String", $text_color); 
header ("Content-type: image/gif"); 
imagegif($im);

result: none image shown
gd version: 2.0.15
from the phpinfo()
GIF Read Support enabled
JPG Support enabled
PNG Support enabled

when i changed it to png the same thing happened...dumfounded

if i want to upgrade to gd 2.0.33..where do i start..frm the gd site, they mentioned bout compiling it..im using windows...so please help

others spec:
apache
windows
current gd 2.0.15
current php 4.3.3

help me

Recommended Answers

All 2 Replies

You haven't actually set the background colour - you've just created the object.

imagefill($im, 0, 0, $background_color);

ok..i figure out what it is..the variable is not consistent...
anyway how to upgrade to gd 2.0.33..

another thing..my current gd version supposed to support gif..but when i changed it to content type=gif ..no image appeared...so i have to use png instead..WHY????

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.