$pic = $_GET['pic'];
$info = getimagesize($pic);
switch($info['mime'])
{
case 'image/jpeg': $img = imagecreatefromjpeg($pic); break;
case 'image/gif': $img = imagecreatefromgif($pic); break;
case 'image/png': $img = imagecreatefrompng($pic); break;
default: exit(); break;
}
#$W = $info[0];
#$H = $info[1];
#$T = $info['mime'];
$x = imagesx($img);
$y = imagesy($img);
$black = imagecolorallocate($img, 0, 0, 0);
imagettftext($img, 20, $x, $y, 0, $black, 'font.ttf', 'Copyright');
header('Content-Type: image/jpeg');
imagejpeg($img, 75);