I use this on my website and it works perfectly
It creates your logo on the bottom right, and then saves it.
<?
function watermark($srcfilename, $newname) {
$watermark="http://www.ellx.net/images/watermark.png";
$quality="100";
$imageInfo = getimagesize($srcfilename);
$width = $imageInfo[0];
$height = $imageInfo[1];
$logoinfo = getimagesize($watermark);
$logowidth = $logoinfo[0];
$logoheight = $logoinfo[1];
$horizextra =$width - $logowidth;
$vertextra =$height - $logoheight;
$horizmargin = round($horizextra / 2);
$vertmargin = round($vertextra / 2);
$photoImage = ImageCreateFromJPEG($srcfilename);
ImageAlphaBlending($photoImage, true);
$logoImage = ImageCreateFromPNG($watermark);
$logoW = ImageSX($logoImage);
$logoH = ImageSY($logoImage);
ImageCopy($photoImage, $logoImage, ImageSX($photoImage)-$logoW, ImageSY($photoImage)-$logoH, 0, 0, $logoW, $logoH);
//ImageJPEG($photoImage); // output to browser
ImageJPEG($photoImage,"./images/uploaded/".$newname, $quality);
ImageDestroy($photoImage);
ImageDestroy($logoImage);
}
?>