<?php


function WaterMark($img_src){
	

// Load the stamp and the photo to apply the watermark to
$stamp = imagecreatefrompng('logo.png',100);
$stamp2 = imagecreatefrompng('logo2.png',100);
$im = imagecreatefromjpeg("$img_src",100);


// Set the margins for the stamp and get the height/width of the stamp image
$marge_right = 0;
$marge_bottom = 0;
$sx = imagesx($stamp2);
$sy = imagesy($stamp2);
$imgx = imagesx($im);
$imgy = imagesy($im);
$centerX=round($imgx/2-$sx/2);
$centerY=round($imgy/2-$sy/2);

// Copy the stamp image onto our photo using the margin offsets and the photo 
// width to calculate positioning of the stamp. 
imagecopy($im, $stamp2, $centerX,$centerY, 0, 0, imagesx($stamp2), imagesy($stamp2));

 imagejpeg($img, $newcopy, 100);

// Output and free memory

imagejpeg($im,"$img_src",100);


}
?>