Hi,
Great! The watermark was centered immediately as soon as I changed the line in your suggestion below. However, I did not even try the margins because I do not need them since I got the watermark already centered on target images.
Regarding the integration into the core script, I am waiting for my script developer's reply.. And I will get back to the forum soon after the finalization of the watermark option.
Thank you for such great script and help!
Best Regards,
KSR - yepko.net
It is not a trivial task to determine if image was watermarked or not. I'm thinking about adding some tag to image meta data (where it saves camera, iso, etc.) and would skip those already watermarked. Unfortunately, i'm currently very busy and will not have time to implement this at least for few weeks. Maybe someone else with coding skills could implement that?
How to center watermark? Did not try it, but i think it will center watermark if you replace following in watermark_image.class.php
$dest_x = $size_x - $watermark_x - $this->offset_x;
with this
$dest_x = ($size_x - $watermark_x)/2 - $this->offset_x;
As of now, i think you can only control right and bottom margins.
In order to set these margins, you'll have to change watermark_image_example.php
replace this
$img = new Zubrag_watermark($image_path);
with this
$img = new Zubrag_watermark($image_path, RIGHT-MARGIN, BOTTOM-MARGIN);
for example
$img = new Zubrag_watermark($image_path, 10, 10);
For watermarking image with some text use another script http://www.zubrag.com/scripts/watermark-image-text.php
I don't have answer to "adjust width of the watermark.png" question. Will have to analyze existing code and try a couple of things, but can't do it right now because of lack of time, sorry