I currently have a watermark on my website for any images over a certain dimension.
The code is below:
I am going to make this image even more transparant and i want to have it as the absolute center or any image.
Any idea what i need to change to do this?
Many thanks,
Andy
The code is below:
Code:
<?
$src = $_GET['src'];
header('Content-type: image/jpeg');
//this will prevent the watermark from showing up in the thumbnail images
$size = getimagesize($src);
if ($size[1] < 530) {
$watermark = imagecreatefrompng('empty.png');
} else {
$watermark = imagecreatefrompng('watermark.png');
}
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
$image = imagecreatetruecolor($watermark_width, $watermark_height);
if(eregi('.gif',$src)) {
$image = imagecreatefromgif($src);
}
elseif(eregi('.jpeg',$src)||eregi('.jpg',$src)) {
$image = imagecreatefromjpeg($src);
}
elseif(eregi('.png',$src)) {
$image = imagecreatefrompng($src);
}
else {
exit("Your image is not a gif, jpeg or png image. Sorry.");
}
$dest_x = $size[0] - $watermark_width - 0;
$dest_y = $size[1] - $watermark_height - 0;
imagecolortransparent($watermark,imagecolorat($watermark,0,0));
imagecopyresampled($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $watermark_width, $watermark_height);
imagejpeg($image, "", 95);
imagedestroy($image);
imagedestroy($watermark);
?>
I am going to make this image even more transparant and i want to have it as the absolute center or any image.
Any idea what i need to change to do this?
Many thanks,
Andy
worked a treat