$tmp = $_FILES['pic']['tmp_name'];
if (isset($tmp))
{
$file = $tmp; // Picture to resize
$mark = "logo1.gif"; // The watermark to use.
$newfile = "watermarked.jpg"; // The resized and watermarked picture that we'll end up with. Make sure this directory is writeable.
list( $sourcewidth, $sourceheight ) = getimagesize($file); // Size of source photo for resizing
list( $markwidth, $markheight ) = getimagesize($mark); // Size of source photo for resizing
$x = $sourcewidth - ($markwidth + 10);
$y = $sourceheight - ($markheight + 10);
// Load pictures
$source = imagecreatefromjpeg( $file ); // Source photo
$watermark = imagecreatefromgif( $mark ); // This is our watermark.
//imagecopymerge ( resource $dst_im , resource $src_im , int $dst_x , int $dst_y , int $src_x , int $src_y , int $src_w , int $src_h , int $pct )
//763-28 y=725
imagecopymerge( $source, $watermark, $x, $y, 0, 0, $markwidth, $markheight, 100 );
// Saving
imagejpeg( $source, "$newfile" ) or die ( 'Could not save picture! Please check permissions.' ); // Save file on disk
// Cleaning up
imagedestroy( $watermark ); // Clear memory
imagedestroy( $source ); // Clear memory
?>
Click here to see your new pic
}
?>