<?php header('content-type: image/jpeg');
$watermark = @imagecreatefrompng('watermark.png') or exit('Cannot open the watermark file.'); 
imageAlphaBlending($watermark, false); 
imageSaveAlpha($watermark, true); 
$image_string = @file_get_contents($_GET['src']) or exit('Cannot open image file.'); 
$image = @imagecreatefromstring($image_string) or exit('Not a valid image format.'); 
$imageWidth=imageSX($image); 
$imageHeight=imageSY($image);
$watermarkWidth=imageSX($watermark); 
$watermarkHeight=imageSY($watermark); 
$coordinate_X = ( $imageWidth - 25) - ( $watermarkWidth); 
$coordinate_Y = ( $imageHeight - 25) - ( $watermarkHeight); 
imagecopy($image, $watermark, $coordinate_X, $coordinate_Y, 0, 0, $watermarkWidth, $watermarkHeight); 
imagejpeg ($image, NULL, 100); 
imagedestroy($image); 
imagedestroy($watermark); 
echo '<span style="color: #aaa;">cool'.$image . $imageWidth . $imageHeight.'</span>';
?>