hello!
thanks for the links, that was a good read.
when i run phpinfo()
i get this:
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
JPG Support enabled
PNG Support enabled
WBMP Support enabled
so basically gd support is ok right? i run this sample code found in webmonkey:
http://webmonkey.wired.com/webmonkey/01/21/index4a_page3.html?tw=programming
<?php
//Send a header to the browser indicating
//that this is a PNG image.
//Remember to never send anything
//to the browser before the header,
//unless you're just itching for an error.
header("Content-type: image/png");
//create a new image called $image, 200 by 200 pixels
$width = 200;
$height = 200;
$image = imagecreate($width, $height);
//Allocate some colors.
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
//Fill in the entire image with a white background.
//Note that the first two arguments (after the
//image name) are the X and Y coordinates of
//the upper left corner of the rectangle,
//the second two are the coordinates of the lower
//right corner, and the last argument is the fill color
imagefilledrectangle($image, 0, 0, $width, $height, $white);
//Write a message in black.
//The arguments to ImageTTFText are, in order,
//the image name, the height in pixels of the text,
//the angle (starting at 0 for normal text,
//and proceeding counterclockwise,
//the X and Y coordinates of the starting point,
//the color, the TrueType font file, and the
//content of the text.
imagettftext($image, 150, 0, 20, 110, $black,
"../fonts/verdana.ttf", "I love you!");
//Push the completed image out.
imagepng($image);
//Finally, free up the memory allocated for the image.
imagedestroy($image);
?>
i dont get an output, as suggested i commented the header to see some errors and saw this:
Warning: imagettftext(): Could not find/open font in /var/www/html/phptestimage2.php on line 39
where should i start fixing? as phpinfo shows, i believe i have gd support ok. but why cant i generated images? for now i just want to see gd support ok then ill go on with the php learning stuff..
thanks for interest in this thread.