Page 1 of 1

Dynamic watermark inside a jpeg

PostPosted: September 13th, 2013, 1:31 am
by BlackCat
I noticed something very new and mysterious to me the other week. I found an image from a website that whenever you'd refresh it, that is, refreshing the direct link with the .jpeg file extension, the watermark would move!!! How is this possible on a jpeg? What is commanding the watermark to move after refreshing and/or accessing the image URL?

I am totally lost as to how the developer(s) accomplished this.

Re: Dynamic watermark inside a jpeg

PostPosted: September 13th, 2013, 3:12 am
by Zorro
In this case, the developer has setup some code that:

1. Loads original image into a cache directory or into system memory on the server.
2. Dynamically adds a watermark to the original image.
3. Sends new watermarked image to browser.
4. Deletes new watermarked image from cache directory (keeping the original) or flushes it from system memory.

This is quite simple actually and is very similar to dynamic thumbnail image generators. Thumbnail generators will generate a thumbnail of a specified image based upon some pixel size parameters passed in the URL and then store the thumbnail in a cache directory; it's cached so the server doesn't waste CPU resources re-sizing the original image each time that particular thumbnail size is requested.

Re: Dynamic watermark inside a jpeg

PostPosted: September 13th, 2013, 11:32 pm
by BlackCat
Wow, great information. Thanks for taking the time to explain this to me. I'm going to try and accomplish this. :) Thank you!