Forum Moderators: coopster

Message Too Old, No Replies

GD-Lib problems

         

justinas zakevicius

12:45 pm on Jan 28, 2005 (gmt 0)

10+ Year Member



Here's a very simple script that I am trying to make into work. However, when I try to access the image_thumb.php script (the one below), it gives me just an empty picture (the one with the X as there is no such file). I have gd-2.0.33_1,1 installed on my server. Any ideas?

<?PHP
header("Content-type: image/jpeg");
$im = @imagecreate(100, 50)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagejpeg($im);
imagedestroy($im);

//}
?>

dreamcatcher

12:55 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Justinas,

Try removing the error suppression (@) symbol. This may give you a clue to the error.

dc

justinas zakevicius

1:03 pm on Jan 28, 2005 (gmt 0)

10+ Year Member



Here's what i get when i remove @:

<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in <b>/usr/webart/www/vhosts/www.example.lt/includes/functions/image_thumb.php</b> on line <b>3</b><br />

[edited by: jatar_k at 7:47 pm (utc) on Feb. 1, 2005]

Birdman

2:05 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds like PHP was not compiled with GD support. You probably need to recompile PHP or maybe see if ImageMagik is available.

justinas zakevicius

2:15 pm on Jan 28, 2005 (gmt 0)

10+ Year Member



How does ImageMagik relates to GD? Is it a part of this lib or essential tool for it? Sorry, I'm not very familiar with this stuff and not sure if our server administrator is as well... Thanks for help.

Birdman

2:21 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, it doesn't relate to GD at all. It's another tool altogether, but equivelant to GD. The reason I brought it up is because it's popular.

If you have root access to the server, just reinstall PHP with GD support.

Regards

Birdman

2:23 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



BTW, have you run phpinfo() to see what it says about GD?