protection of pictures?

Jkay / 2008-04-29 10:28:46   

Hey guys..

Is it possible to protect pictures? I mean is it possible to put a "feature" on them so they can't be saved / downloaded from the site?

Thanks..

Vaska A / 2008-04-29 13:49:02   

What do you mean by "feature"? But, there is really nothing you can do to stop people from grabbing them. Even with Flash websites, it's possible to make screen captures.

If you are uploading really large files...the more likely people might want to grab them.

Jkay / 2008-04-29 20:21:10   

oh yeah i know there's always the screenshot.. I was just thinking if it was possible to disable the "right click" and "save image" funktion, just to make it more difficult..

I know it won't stop the people who really want to steal them..

AntoineLafontaine / 2008-05-09 06:32:55   

It's possible, using jQuery (included with indexhibit) to "catch" the right-click event of the mouse and then just use a "return false" to block the right-click event to propagate... I know this sounds technical, but this will "disable" the right-click regular event...

This won't stop people from getting your images if they know the path, but it will make it a bit more obfuscated... and probably difficult and/or frustrating for regular users who will not be able to use their menu anymore... use with caution, this should be considered a usability issue.

code below (insert in the template file in the dynamicJS section, or use an external JS file):

Should disable right-click menu for the whole document
$(document).bind("contextmenu",function(e){ return false; });

Only on images
$("img").bind("contextmenu",function(e){ return false; });

This is untested but should work (If I didn't mistype anything...). It is probably possible to do more than this if you dig a bit more in jQuery's docs.

Hope this helps but remember to use with caution.

*EDIT

After I posted this piece of code I started thinking about the point of using such code to try to restrict access/obfuscate etc and I strongly believe that it shouldn't be use for such a purpose... right-click event rerouting for the purpose of offering a custom design context menu with extra functionality might be a constructive way to use this...

anyways, I don't think either that removing it will benefit anybody anyways, so I'll leave it here.

Vaska A / 2008-05-09 07:42:48   

I'm not big on this approach either...but it does exist and it is possible. For the rare occasion...thanks for posting this.

;)

I usually just drag images to my desktop...or make a screenshot.

This thread has been closed, thank you.