I am trying to watermark images using the Imagine library (on a CakePHP project). Cropping images works fine - watermarking does not. I use the example from the Imagine website:
$imagine = new Imagine\Gd\Imagine();
$watermark = $imagine->open('/my/watermark.png');
$image = $imagine->open('/path/to/image.jpg');
$size = $image->getSize();
$wSize = $watermark->getSize();
$bottomRight = new Imagine\Image\Point($size->getX() - $wSize->getX(), $size->getY() - $wSize->getY());
$image->paste($watermark, $bottomRight);
The original example doesn't state an instantiation procedure, so I added what I found on the page. Doing so yields the following error:
Call to undefined method Imagine\Image\Box::getX()
How do I use it correctly?
I've used it like this and it's worked.
test it please