2

I am just about ready to release my photography portfolio site, and I am really paranoid about people copying my images.

I've got some nifty jQuery that disables right clicking on images, and now I want to create an alert if someone presses print screen on their keyboard.

My code doesnt seem to work and I am sure that I have the correct keyCode:

<script type="text/javascript">
$('*').bind('keypress', function (e) {
if (e.keyCode == 44) {
alert("don't copy my work");
return false;
}
);
</script>

The interesting thing is that my code works for other keypresses such as enter (13)? Can anyone help expand on why this may not be working?

Many thanks!

Steve2011
  • 43
  • 1
  • 5
  • 8
    If you don't want people to copy them, you should add a watermark to your images. There's no way to stop people from copying those images if you display them on your website, since they're downloaded to their computers anyway. – fivedigit Jan 30 '12 at 11:48
  • See this duplicate: http://stackoverflow.com/questions/2457326/disable-clipboard-print-screen-on-webpage and this http://stackoverflow.com/questions/5307160/sniffing-the-print-screen-key-to-attach-its-contents-on-a-composed-mail-autom – gideon Jan 30 '12 at 11:49
  • do you think it will be fully effective as it can be bypassed by simply disabling javascript – Madhur Ahuja Jan 30 '12 at 11:49
  • Have you thought about the fact that the URL of the image will still be available through the source code, so it would still be quite easy to copy the image? Many people have tried preventing such behavior and I believe most people have failed in providing a solid solution. – Christofer Eliasson Jan 30 '12 at 11:50
  • 3
    Please don't do that. It's very rude and makes MY experience of using MY browser on MY computer poor. Specifically, if I want to go back to the previous page, I now can't do that using the context menu. In general, hijacking the browser context menu (or simply disabling it as you're doing) is a terrible user experience and would make me not want to come back to your site again. – dty Jan 30 '12 at 11:53

1 Answers1

1

No matter what you put in place, if your image files are available by URL, then any workarounds you do, can be undone.

Web designers put a lot of workarounds in place to prevent users downloading their images (ie. disabling right-click). But everything viewed on the web is downloaded to the users temp folder anyway, so this is pointless.

If you are concerned about your copyright images being accessed, I would recommend putting a watermark image on the actual image files themselves, rather than placing them on with client side scripting (which can be disabled in the users browser).

Alternatively only upload low-res images, and state that high-res is not available direct online.

Curtis
  • 101,612
  • 66
  • 270
  • 352
  • I guess that is the only way then! Shame as the watermark spoils the image, but I guess that is the world we live in. – Steve2011 Jan 30 '12 at 12:01
  • yep! It also applies to software security or anything digital in general. People will find a way if they motivated enough, you should weigh in whether you need to care. – gideon Jan 30 '12 at 12:09