<?php
$imagesource = $_GET['plaatje'];
//deze moet je nog even aanpassen:
$watermark = "plaatje.gif";
$filetype = substr($imagesource,strlen($imagesource)-4,4);
$filetype = strtolower($filetype);
if($filetype == ".gif") $image = @imagecreatefromgif($imagesource);
if($filetype == ".jpg") $image = @imagecreatefromjpeg($imagesource);
if($filetype == ".png") $image = @imagecreatefrompng($imagesource);
if (!$image) die();
$watermark = @imagecreatefromgif($watermark);
$imagewidth = imagesx($image);
$imageheight = imagesy($image);
$watermarkwidth = imagesx($watermark);
$watermarkheight = imagesy($watermark);
$startwidth = (($imagewidth - $watermarkwidth - $imagewidth + $watermarkwidth) );
$startheight = (($imageheight - $watermarkheight) );
imagecopymerge($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight, 70);
imagejpeg($image);
imagedestroy($image);
imagedestroy($watermark);
?>