I have image creation code in image_creator.
<?php
header("Content-Type: image/jpeg");
$im = ImageCreateFromGif("photo.gif");
$black = ImageColorAllocate($im, 255, 255, 255);
$start_x = 10;
$start_y = 20;
Imagettftext($im, 12, 0, $start_x, $start_y, $black, 'verdana.ttf', "text to write");
Imagejpeg($im, '', 100);
ImageDestroy($im);
?>
The file for image output is image.php and has below code
<html>
<head>
</head>
<body>
<img src="http://localhost/image_creator.php"/>
</body>
</html>
When I run image.php, I just get a blank page. Why is it so?
$black = ImageColorAllocate($im, 255, 255, 255);
- this is white, not black. Do you get any errors? Checked the error-log?$black
is just because hes copied code from php.net: php.net/manual/en/function.imagettftext.php./verdana.ttf
.