Discouraging Internet Photo Thieves

Steve Miller TX

In light of the recent rampage of storm photo thieves and rustlers, I thought this would be relevent to all chasers with a website. While not a total prevention, this will help discourage those wanting to swipe your photos from your website using the left click of a mouse. They'll have to work at it. Here is the javascript to do that:

<script>

msg="Nasty message goes here";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(msg);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(msg);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

</script>


To see this in action, go to: http://www.texastailchaser.com/2005blog/20...50531/index.htm
 
That is not foolproof. It can be over-ridden by clicking with both mouse buttons at the same time, when the right-click menu will come up normally. Least it does on both of my computers.
 
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus ([email protected]) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="RIGHT CLICKS DISABLED ON THIS SITE!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>




Above is a disable right click code. It's usually a good theft deterrent, but have heard it's not completely foolproof.
 
Doesn't work with Firefox

Hi Steve,

I didn't have any problems using the right click with Firefox. I noticed when I hit your main site that I got a message about your site not supporting Netscape, but going directly to your link didn't cause me any problems.

James
 
That is not foolproof. It can be over-ridden by clicking with both mouse buttons at the same time, when the right-click menu will come up normally. Least it does on both of my computers.

Anthony's code which includes the second or third mouse button *should* take care of this. I had forgotten about those fancy mice. Be sure to let us know if you can still get around it with mouse clicks.

A thief could still grab your image by reviewing your source code and deriving the url path to the image. That requires some actual work though. This is only intended to eliminate the casual thief with neither the patience nor the know-how of working around this. Regardless of what type of thief, they will try the right click thing first and at least on my site get a nasty warning message. ;-)
 
Re: Doesn't work with Firefox

I didn't have any problems using the right click with Firefox. I noticed when I hit your main site that I got a message about your site not supporting Netscape, but going directly to your link didn't cause me any problems.

Hmmm....did you try the code that Anthony provided? Firefox should trigger a Nestscape event. I'm about to hit the sack, but I'll tinker around with this more tomorrow. Maybe we can all together create some code that will fry the thief's motherboard. LOL
 
Im still able to right click and save images with the latest version of Opera.

Dang...forgot about the Opera browser. Perhaps we can add code to block anything other than IE or FF? I do that on my main site to restrict it to IE only because of all the complex DHTML I use and was too lazy to code for NS (this was well before the rise of FireFox though).
 
One can simply turn javascript off in something like Firefox. You'll have a hard time restricting to a specific browsers as well. If someone wants to they are most likely going to steal your pictures, might as well as not spend the effort in doing this. A simple copyright notice on the image is going to be as good as you can get without taking away from the image.
 
All you have to do is VIEW SOURCE of the page and all the URLs to the images are right there in the source code. That no right click stuff only stops the honest people.
 
yea but usually they'll try the right click first. then they will get my nice little message.

It's just like locks on stuff. if someone wants something bad enough, they'll get it either way. even if you couldnt get around the right click thing all you gotta do is a screen capture. I figured it took about 5 minutes to put one more obstacle in between a potential photo theif and my photos. plus it looks cool right? :wink:
 
Im still able to right click and save images with the latest version of Opera.

Dang...forgot about the Opera browser. Perhaps we can add code to block anything other than IE or FF? I do that on my main site to restrict it to IE only because of all the complex DHTML I use and was too lazy to code for NS (this was well before the rise of FireFox though).

For many reasons that I won't go into here, might I suggest a Standards Compliant version?

Many versions of IE in use are not compliant. But most modern browsers are. And even better, a standards compliant version would be backwards compatible and accessible to all.

Along with a script you could also hide your images from "view source" by placing your image references into external CSS files as div backgrounds. You could manage all of your presentation in one master style sheet (layout, fonts, colors, etc.), then import additional style sheets that only contain the photo reference divs for that specific page. Then none of the image references would show up in "view source."

Someone could follow the cascade of imports and linked CSS and eventually find the image reference. But combining this with a standards compliant disable script and a cryptic naming convention could make things extremely tedious for casual thieves. And better yet, once you set up a standards solution would be easy to maintain and modify your pages.

Good thread.

db



http://stormcast.net/
 
Two words

Print Screen.

Will save screen to clipboard. Then all you have to do is put into a picture editing program and crop. If image is bigger than one screen, could still do it, just involves aligning partial cuts.

Take care :)
Shane
 
All that is fine and dandy when you have it on your own website. But what are you gonna do if you link an image here? It's wide open in the forum.
 
All that is fine and dandy when you have it on your own website. But what are you gonna do if you link an image here? It's wide open in the forum.

I guess that would be an argument for keeping "Target Area > Reports" password protected.
 
Blake, all I had to do was click on your picture. After it enlarged, your right-click message failed to show up. I immediately copied it and put it on my website. Now it's MY picture, and I'd appreciate it if you took my picture off your website. Immediately.

lol . . . just kidding. I don't even have a website, but you may want to see if you can fix the problem of right click working after enlargement..
 
I was just about to bring up the same issue as Bryce - but he beat me to it. I use MS FrontPage as my HTML editor and insert galleries for each chase. Today I revised every gallery (whew) ... I'm inserting a watermark on images that are most valuable to me, but in past years' galleries where I don't care as much I was just inserting the java code provided here. It works great as far as the thumbnails are concerned, but as Bryce brings out - as soon as I enlarge the image I can right-click.

Any ideas? Wanting to reload the entire website over the weekend -

Thanks -
 
updated/improved code

OK, some of the issues raised here were 1) Javascript disabling 2) Opera browser 3) 3-button mice 4) Using the no-script code in a pop-up window

Keep in mind that all of this is NOT intended to be foolproof. This is only meant to discourage the casual thief or those that don't understand that taking the images are actually stealing if they aren't selling it. As David pointed out, saving a screen shot and editing out the photo is still an option. Again, this is only a deterrent, not a fool-proof preventative measure. I hope everybody actually reads this before posting ;-)

For users that diable javascript, add this code between the <head> tags in your code:

<noscript>
<meta http-equiv="refresh" content="0; URL=../browserError.htm">
</noscript>


This will take them to another page that you designate if they have javascript disabled. Of course, a user can still disable meta refresh in their browser, but again, this is only a deterrent! ;-)

To allow only IE and Firefox browsers and specifically block Opera browsers as well as accomodate mice with 3 buttons, use this code here:

<script>
msg="Nasty message goes here";

if ((navigator.userAgent.indexOf("Opera")== -1) && (navigator.userAgent.indexOf("MSIE")!= -1) || (navigator.userAgent.indexOf("Firefox")!= -1)) {

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(msg);return false");

}else{
window.document.location.href = "../browserError.htm";
}
</script>


Now, you can save the javascript code above as a file and call it something like "noclick.js" and be sure to remove the<script></script> before doing so. Then, call the code in your webpage with this line:

<SCRIPT SRC="../noclick.js"></SCRIPT>

I'm using this in my pop-up windows that contain the larger pic. Here are two lines of code that will help you do that if you have saved the no-click described above:

win = window.open("", menubar='no', toolbar='no');
win.document.write("<html><SCRIPT SRC='../noclick.js'></SCRIPT><body><img src=01.JPG></body></html>");


I hope this helps reduce some of the swiping of photos out there. I also believe that by doing this and somebody still steals your photos and uses it for profit, you'll have an easier time proving their malicious attempt by showing you employed considerable effort to prevent copying of images. 8)
 
Back
Top