Help with image processing
Posted: Wed Dec 24, 2003 11:46 am
Hi,
I'm trying to write a script that graphs my site traffic data for me. I'm not familiar with imaging with php, so I'm just playing around right now.
First, I ran the phpinfo and verfied that gd is supported:
gd
GD Support enabled
GD Version 1.6.2 or higher
WBMP Support enabled
So I practically copied a sample program:
And it didn't work. I tried looking at it from an html page with the img tag as well, and it gave me one of those red crosses. The worst thing is, the red cross isn't 500x250 big. Anyway, any help would be appreciated.
Also, I'm not really sure what that header() line does for me. Shouldn't it also work if I just removed that line?
Thanks.
I'm trying to write a script that graphs my site traffic data for me. I'm not familiar with imaging with php, so I'm just playing around right now.
First, I ran the phpinfo and verfied that gd is supported:
gd
GD Support enabled
GD Version 1.6.2 or higher
WBMP Support enabled
So I practically copied a sample program:
Code: Select all
<?php
if(!($im = imagecreatetruecolor(500, 250)) echo "error creating im";
$tc = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 1, 5, 5, "This is not a Hello World", $tc);
header("Content-type: image/jpg");
imageJPEG($im);
imagedestroy($im);
?>Also, I'm not really sure what that header() line does for me. Shouldn't it also work if I just removed that line?
Thanks.