can anybody shed any more light on this?
im struggling to work out where to actually put the code.
im working with Uncle Cheese's Image_gallery.
do i apply the watermark when images are UPLOADED via the CMS, or is it when they are RENDERED?
do i do something like this?
public function Watermark(GD $gd) {
// Read the watermark picture
$watermark = imagecreatefrompng($URL . '/themes/Ace/images/watermark.png');
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
// Read Full size Silverstripe image
$imageToWatermark = imagecreatefromjpeg($this->URL);
// Calculate sizes
$size = getimagesize($this->URL);
$dest_x = $size[0] - $watermark_width - 5;
$dest_y = $size[1] - $watermark_height - 5;
// Do transformations and save image in assets
imagecopymerge($imageToWatermark, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 40);
imagepng($imageToWatermark,$webroot . $this->filename . "_watermarked.png");
// And this is the trick ;-) Create an object Silverstripe can work with....
$GDoutput= new GD($webroot . $this->filename . "_watermarked.png");
return $GDoutput;
}