<?php
header('Content-type: image/gif');
$img = $_GET['img'];
$wh = getimagesize('copy.png');
$fh = getimagesize('http://load.themes.mobik.ru/'.$img);
$rwatermark = imagecreatefrompng('copy.png');
$sx=$fh[0]-$wh[0]-0;
$sy=$fh[1]-$wh[1]-0;
if(pathinfo($img, PATHINFO_EXTENSION)=='jpg' || pathinfo($img, PATHINFO_EXTENSION)=='jpeg')
{
$rfile = imagecreatefromjpeg('http://load.themes.mobik.ru/'.$img);
imagecopy($rfile, $rwatermark, $sx, $sy, 0, 0, $wh[0], $wh[1]);
} elseif(pathinfo($img, PATHINFO_EXTENSION)=='gif')
{
$rfile = imagecreatefromgif('http://load.themes.mobik.ru/'.$img);
imagecopy($rfile, $rwatermark, $sx, $sy, 0, 0, $wh[0], $wh[1]);
}  elseif(pathinfo($img, PATHINFO_EXTENSION)=='png')
{
$rfile = imagecreatefrompng('http://load.themes.mobik.ru/'.$img);
imagecopy($rfile, $rwatermark, $sx, $sy, 0, 0, $wh[0], $wh[1]);
}
imagegif($rfile,'', '100');
imagedestroy($rwatermark);
imagedestroy($rfile);
?>


