Watermarking images on the fly

Support for Template related issues
Post Reply
User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Watermarking images on the fly

Post by leo » Mon Apr 26, 2010 5:31 am

Hi All,

I would like to watermark images on the fly with this:
http://bokehman.com/watermark
Where to put the watermark function? Into the library/image/image.php or catalog/controller/product.php?
I have tried the product.php, it creates the watermarked image but only this image is visible on the site, no other content.
Could somebody put me in the right direction?
br
Leo

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Watermarking images on the fly

Post by Brent » Mon Apr 26, 2010 6:49 am

It needs to be done in library/image/image.php
You have to do it after the image is re-sized.

I looked at this, but needed a way to cache the results and never got back to it.
If you do it after the image is re-sized, I think it will have to be recreated every time the image is requested.

Try it and let me know how it works out and how it affects page load time.

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Watermarking images on the fly

Post by leo » Wed Apr 28, 2010 11:57 am

I decided to watermark the images during the image upload process, so i modified the library/image/image.php.
When I upload an image a 40x40 watermarked image appears under the /cache directory. The other resized images will be created if they are needed (automatically). Works fine.
Unfortunately the original uploaded image is not watermarked, so that nor the popup image. Any idea? Where can I "catch" this image?

Another question: is it possible to protect/hide the image folder? So, no direct links to images.
br
Leo

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Watermarking images on the fly

Post by Brent » Wed Apr 28, 2010 1:32 pm

Another question: is it possible to protect/hide the image folder? So, no direct links to images.
No. Your image links would be no good then.

If your idea is to do a permanent water mark to prevent copy-write infringement, I think doing it on the uploaded image might be the best result.
Then your full size image and all the re-sized images would have the same water mark to scale.

Either that, or water mark images before upload.

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Watermarking images on the fly

Post by leo » Thu Apr 29, 2010 1:37 am

I modified the admin/controller/image.php. After uploading the origonal file, it will be watermarked permanently.
It works fine.
Thanks.
Leo

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Watermarking images on the fly

Post by Brent » Thu Apr 29, 2010 6:36 am

If you want to share your code, I could put in the next release.

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Watermarking images on the fly

Post by leo » Thu Apr 29, 2010 12:10 pm

I am going to test it and will share the code.

Creater
Posts: 3
Joined: Wed Aug 10, 2011 5:58 am
Location: Canada

Re: Watermarking images on the fly

Post by Creater » Wed Aug 10, 2011 6:06 am

I also interested in watermark my images. Will you please share the code with us?

Creater
Posts: 3
Joined: Wed Aug 10, 2011 5:58 am
Location: Canada

Re: Watermarking images on the fly

Post by Creater » Wed Aug 10, 2011 6:09 am

I have one more question. Is watermarked images are cached or not?

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Watermarking images on the fly

Post by leo » Wed Aug 10, 2011 6:18 am

I will add it to the core soon. The images are cached.

Post Reply