I have a script that adds some text to an image. Works great. One of the parameters of the script is the color of the text. I have it set to black RGB colors. Why does is sometimes display black, then sometimes white the sometimes green the sometimes red. Cant understand it. It should stay black all of the time
Here is the link. Click on different posts with pictures and you will see it.
http://www.firstcrackcharters.com/fishingreports/
Here is the script that is called in an image tag on the output page.
<?php
Header("Content-type: image/jpeg");
$photo_name = urldecode($name);
$source = ImageCreateFromJPEG("/home/u4/firstcrack/html/upload_pics/$photo_name");
$image = ImageCreate(525, 394);
$copy = imagecopy($image, $source, 0,0,0,0,525,394);
$col = ImageColorAllocate($image, 0, 0, 0);//0,0,0 is the RGB black color
ImageTTFText($image, 16, 0, 10, 20, $col, "/home/u4/firstcrack/html/fishingreports/arial.ttf", "www.firstcrackcharters.com");
Imagejpeg($image,'',100);
ImageDestroy($source);
ImageDestroy($image);
?>
Here is the image tag called on the main page
print"<img src=pic.php?name=$db_output>"; //Image Tag
Stan