Log in

View Full Version : Preventing download of my images



jason_21218
02-16-2010, 02:00 PM
Greetings All,


I wish to prevent my images from being downloaded by dragging. I know there are always ways someone can get around this and grab images off a site, but I want to at least put up a little road block. I have used a bit of code which said some thing like 'on mouse over no action' or something like that.

Is there a way to apply this type of function globally to all images on a site, without adding code to each image??

Nile
02-17-2010, 12:42 AM
Insert this code in the <head> part of your document:


<script type="text/javascript">
var drag = function(){
var els = document.getElementsByTagName("img");
for(var i = 0; i < els.length; i++){
var over = document.createElement("div");
over.style.position = "absolute";
over.style.height = els[i].height;
over.style.width = els[i].width;
over.style.backgroundColor = "transparent";
over.style.left = els[i].offsetLeft;
over.style.top = els[i].offsetTop;
document.body.appendChild(over);
}

}
</script>

Insert this code right before </body>:


<script type="text/javascript">
drag();
</script>

djr33
02-17-2010, 03:07 AM
It cannot be said enough that trying to stop people from saving media on your site cannot be done. It can be made difficult especially with audio and video, but with images there are so many ways to save them that it's really not worth the effort. Anything that comes close to stopping people (even just for a few of the ways) will probably annoy your other "real" visitors, and people will enjoy your site less.

When you publish something on the web it may be stolen. That's life, and that's how it works and how it will work. There really isn't much you can do about it.

There are always ways you can try to make it harder for the average user, but it won't be the average user that is stealing from your site: it will be people who know what they are doing. And if an average user wants to steal your content enough, I'm confident they could learn how.

The main reason that you can't stop people from doing this is that they can do a screen capture. So nothing at all can stop this. (The only method I know about is to place it in a form of media (for example a quicktime movie) that outputs it right into video memory rather than the actual "screen", but there are then many other ways around that, or just using a Mac or other computer that doesn't do multi-layered video memory).

You can try, but it won't work. You can ignore me on this (and most people do for a while until they try it for themselves and figure out how it works), but while you try, please consider how it may negatively affect the rest of your users. Frequently it's better to just let people steal and not annoy the "good" users in the process.


The real methods you have available to stop this are:
1. Copyright: if something actually matters in the end, you can claim legal ownership. For example, if someone else uses your content on their webpage, you can contact their host and they will suspend an account if it is a breach of copyright. (at least this happens often... sometimes the legal issues get more complex if it actually goes to court, etc)
2. Watermarks: make your image messed up so that if they steal them they aren't really stealing anything.
3. Small resolution: don't post full size images on your website. Post small images so that if they steal them they don't have the "real thing".

traq
02-17-2010, 04:19 AM
The "big picture" is what people don't understand.

Visitors don't "go to" your website. You send your website to your visitors.

This means that people don't have to "figure out" a way to save your content - it's already saved on their computer. They may not know exactly where (e.g., somewhere in their temp internet folder), but that's basically the only roadblock. And that's the worst case scenario: they can almost always just use [print screen].

more, if you're interested. I think I've done enough hijacking. :)

Nile
02-17-2010, 04:32 AM
I believe all he wanted was to not let the user drag the image onto there desktop... My code does that.

jscheuer1
02-17-2010, 05:59 AM
Code can be written for various things like this. Generally though, it's not cross browser. I didn't test your code, so I cannot be certain in this case Nile.

But it's somewhat immaterial. The real problem with these schemes is that they add to the page load and can cause unexpected issues in some situations. Users should be able to make copies for their own non-commercial use. If you are selling the images, never put the actual full quality image on the web.

The images are often not worth protecting, it is more a matter of pride than economics. Where there is a real issue of economics, copyright law is your best protection. But you should take care first to use lower res versions of images, and/or thumbnails only, and/or watermark them if economics is a real issue.

A fairly inexpensive way to protect your images should legal action ever become necessary is to in advance put them on a CD or other media (prints or negatives will do as well, and can be good for individual images) and mail them to yourself. Keep the envelope/package unopened unless or until you are in a binding forum like court or arbitration. There you can open the package after first establishing that the postmark's date shows the date of origin of the images and show those involved that you had them first.

djr33
02-17-2010, 07:11 AM
Nile, that code will work for some visitors. I have never seen a code that will stop that functionality for safari on OSX, though. That's not a majority of users, but the question is whether it's worth having the code for most users if not for all users.