Search code examples
javascriptimagedhtml

Can an image be included in a webpage but protected from copying/saving?


I have a website where I display digital proofs for clients of professional photographers. I would like to include an option of 'zooming' into the full resolution version of the image, but it is absolutely imperative that it be practically impossible for the end user to reconstruct and save/print the image.

Obviously simply disabling right clicking is out, as the user could simply dig up the image in the cache. Breaking the image into tiles, then reconstructing them via javascript has merit; the user could still dig up the tiles and put them together in Photoshop, but is that practical for them? That's up for debate. I was also wandering today if the image couldn't be read, sent as a character string of pixel color values, and then constructed on the client side using an absolutely positioned element for each pixel.

But my potential solutions seem to be getting more and more ridiculously convoluted. And I'd like something that's been tested and shown to be scalable. I can't possibly be the first to deal with this problem. Is there something else out there that I don't know about? What is the standard, accepted way to do this?

As an aside, I am aware that I will want to make the image data unavailable to external http requests. I would plan to have ColdFusion read the image file on demand and stream it to the client.

Thanks!


Solution

  • With 100% reliability, no. For an image to be displayed, it has to be downloaded onto the client's browser, and therefore CAN be retrieved.

    You can make it harder for them to extract the image through various techniques, but none of them make it impossible - if nothing else, they can always just make a screen capture:

    1. slice/dice the image into multiple pices and use table-based layouts to make it appear as a single image
    2. javascript right-click disablers
    3. various cache headers to try and prevent client-side cacheing
    4. CSS overlays to try and prevent right-click->save as on the image itself
    5. display in a Flash/Java app
    6. etc... etc...

    None are 100% reliable, and are all trivial to bypass by a determined (and even slightly knowledgeable) user.