Code:
else if (!empty($thumbnail['filedata']))
{
// write out thumbnail now
$filename = fetch_attachment_path($posterid, $attachmentid, true);
$fp = fopen($filename, 'wb');
fwrite($fp, $thumbnail['filedata']);
fclose($fp);
unset($thumbnail);
/* WATERMARK by Robbban*/
$wmark = "http://www.hl2insider.net/forums/watermark.png";
$im = imagecreatefromjpeg(fetch_attachment_path($posterid, $attachmentid));
imagealphablending($im, true);
$watermark = imagecreatefrompng($wmark);
$y = imagesy($im) - imagesy($watermark);
$w = imagesx($watermark);
$h = imagesy($watermark);
imagecopy($im, $watermark, 0, $y, 0, 0, $w, $h);
imagejpeg($im, fetch_attachment_path($posterid, $attachmentid), 100);
}
}
correct?