Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rocko918

macrumors member
Original poster
Nov 5, 2003
60
0
Bristow , Va
I was wondering if there is a way to prevent anyone from downloading my images by right clicking on them. Other than a water mark is there a way to code it so the images are not right clickable and save as?

I could use flash but was wondering if there was another way.

Thanks for the Help!
 
Yes, take it off the internet. There are javascript apps that will not let you right click, but that is easy to get around. Bottom line, anyone can steal it. Your best bet would be to make it a back ground and place a transparent image over it. I've seen that done and it is the best way but there is always print screen, or view the source to find the image.
 
Unfortunately, if someone really wants to get your images they will. A good way to "hopefully" prevent people from stealing your work is to disable the right-Click feature, and also give them a message that might change their mind. Use this code, and you can change the alert to whatever you want.

Code:
<script language="JavaScript1.2"><!--

function right(e) {
* if (e && e.which && (e.which == 3 || e.which == 2)) return false;
* else if (window.event && (event.button == 2 || event.button == 3)) {
* * alert('Stealing people's work is wrong and unehtical, please do not use or distribute mine as your own.  Thank you.');
* * return false;
* }
* return true;
}
function nocontextmenu() {
* *alert('Stealing people's work is wrong and unehtical, please do not use or distribute mine as your own.  Thank you.'); return false
}
document.onmousedown=right;
if (window.captureEvents) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
document.oncontextmenu = nocontextmenu;
document.onmousedown = right;
document.onmouseup = right;

//--></script>
 
Some great ideas here.

The javascript.. I am not good with it but i put that in the <head> right? Anything else i should do?

Thanks
 
yep, just paste it in between the <head> </head> tags and that's it.

You can edit this line to say what you want it to.

Code:
alert('Stealing people's work is wrong and unethical, please do not use or distribute mine as your own.  Thank you.');
 
You sure are putting a lot of effort into this when all someone has to do is view source, copy the URL to image, paste URL in the browser address bar and then do what they want with said image without any javascript protecting it.

I understand your desire to keep works your own, but the only way to do that is like Chico said. Take it off the internet.
 
kingjr3 said:
You sure are putting a lot of effort into this when all someone has to do is view source, copy the URL to image, paste URL in the browser address bar and then do what they want with said image without any javascript protecting it.

That, or people who have javascript turned off can just right click it.

My suggestion is to just have low resolution images. If people try to download them or print them, they will look like crap. The current size of the images is small enough that only people extremely desperate will really print them off. If you are worried about people posting them somewhere else, you need to realize that sh-- happens. Most people will link back to your site, but not all.
 
You can always do a google image search for your images to see if anyone is reposting. Most people too lazy to create their own artwork are too lazy to change the filename, too.
 
I know a few professional photographers who use the small file size technique on their sites. My friend at work posts all his photos for his personal site at 320x240, which looks horrible blown up but it still *decent* enough to see online, and makes load times quite quick too :)
640x480 is pretty good too, even 800x600, but much larger than that and you get people willing to stretch things (if that bothers you). Personally, I cannot stand using an image any larger that its native size because the stretch looks horrible to me, I refuse to do it...but thats me.
320x240 size guy does this for his pee-wee league football site too so that the parents can view the images and then decide if they want prints or not. I thought initially it was too small to accurately view and decide if you want a print, but its not that bad.
 
ok, sorry about that first script...it worked locally, but did not work online. I tested this script in Safari and it works great. Use this code:
Code:
<script language=JavaScript>
<!--

var message="Stealing people's work is wrong and unethical, please do not use or distribute mine as your own. Thank you!";

///////////////////////////////////
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>
 
oaker

Thanks!! That works great!

All,
I know what you are saying but this is just a reminder not to do it. Not ever person is going to know that they can view source and find it that way. Just making it a little bit of a pain to do.

Thanks for all the comments and help.
 
Currently, you can still left-click the image and drag it off.

Better to set it as a background image, I think.
 
Another option would be to put the image into a protected swf, can't right click and download those. Or even better, use a swf placeholder and then a loadMovie action for importing your image.

Just remember that nothing will ever 100% protect your work. A simple screen capture will allow someone to easily defeat any image protection method. I have seen clients waste so much time and resources only for someone, me, to simply say look apple + shift + 4.. ta da! I have your image... hehe... I always love the look on their faces after that demo.

You should consider joining http://creativecommons.org/ and place a disclaimer.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.