Below is a script that will put text onto a jpeg and output it to the browser. But I would like to save the new image with text into a folder on the server or display the new image in a html page. The original jpeg is already on the server. If I was uploading the jpeg and adding text I would be able to put it into a folder but I seem to have problems because the original image is already on the server.
The purpose of this php script is to add the copyright information as the image is displayed. The copyright info then can be changed at anytime without having to adjust the actual jpegs, this would be good if you have 100's of images.
$filename = 'test.jpg';
$image_size = getimagesize($filename);
$image_t = imagecreatetruecolor($image_size, $image_size);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_t, $image, 0, 0, 0, 0, $image_size, $image_size, $image_size, $image_size);
$white = imagecolorallocate($image_t, 255, 255, 255);
$text_size = '24';
$text_x = '20';
$text_y = $image_size-20;
$text = 'Copywrite 2007';
$font = 'arial.ttf';
imagettftext($image_t, $text_size, 0, $text_x, $text_y, $white, $font, $text);
imagejpeg($image_t, null, 100);