I have search this topic in the forum, many people saying the best way is don't upload the images because people always can get the source by look at the 'view source' or screen cut.

This is not the answer what I am looking for. I just want to know the best way of anti-coping.

There are few options for how to anti-copying.

1 I found so many sites when you try to download the images, they only offer a untitle bmp or gif files which could be download.
2 disable the right click.
3 I found some of the sites, when you right click, it will show a link which doesn't point to the image address.

Can some tell how to do this in drupal or if there is a module to do this already. Its quite important for some of the sites.

Thank you very much.

Comments

-Anti-’s picture

> There are few options for how to anti-copying.

If *any* of them worked, so you really think they wouldn't be implemented for drupal by experts? The reason there is no 'image protection' built into drupal (or any other cms) is that there *is* no protection if you want anonymous users to view your content.

> I found so many sites when you try to download the images,
> they only offer a untitle bmp or gif files which could be download.

Look in your browser cache; the image is there (and the transparent gif)

> disable the right click.

Turn javascript off to enable right-click, or don't bother because the image is already in your browser cache.

> I found some of the sites, when you right click, it will show a link which doesn't point to the image address

Doesn't matter where the link points to; just open your browser cache - the image is there.

Here is the one and only rule that any 10 year old needs to know (and most of them do):
'if you can see the image, it is already in your browser cache'.

How long does that take? Open cache -> sort by date -> got the image in 10 seconds.
This works for *any* protection scheme you may try to instigate.

If you want a closed website (ie. no anonymous users can see or link to any of your uploaded files or images), you can use drupal's 'private file system'. For your File system path: you must type ../private exactly like that. Or if you have drupal in a subfolder: ../../private. Doing this creates a folder for your files which is above the public root. This means only authenticated users can ever see or download those files - if node permissions are set to 'anyone', they'll see the nodes without the images, and links to the files won't work.

freelylw’s picture

its bit waster of your time to answer such long question. sorry.

I am only looking for the answer for how to do it. no need to tell me cannot do it. NOt everybody will look at the cache, find the temp files. blablablabla....

-Anti-’s picture

> its bit waster of your time to answer such long question. sorry.

It's a question which comes up occasionally, so I'm sure the thread will help someone else out in the future.

> NOt everybody will look at the cache

Every ten year old knows how to open the cache: IE > tools > internet options > settings > view files.
Firefox and Opera even have a 'page info' button which lists all the media and provides a 'save as...' button.

Here is the best one-page article I've read on the subject:
http://www.naturefocused.com/articles/image-protection.html
But don't expect drupal to have any implementation of these methods built in, because they DON'T WORK.

> I am only looking for the answer for how to do it

I already explained how you can do it for a closed (no anonymous) website.
There is no other way to protect images except not let people view them in the first place.

WorldFallz’s picture

anti is quite right-- if your user can see the image, they have the image. period. don't waste your time.

the only even remotely effective tactic is to watermark them-- but even that can be overcome by someone with enough patience and gimp/photoshop.

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

arpieb’s picture

The best you can hope for is to apply the 80/20 rule... You can find a "good" solution that will block 80% of the attempts out there, but then spend 80% of your time trying to stop the other 20% who are willing to write copious amounts of custom code to break your copy protection or are willing to PhotoShop out your watermarks by hand... It just depends how badly you need to completely block copying of images and/or content.

If it's that critical, then your best bet is to not put it online at all.

-R

----------
"Nothing is impossible - it just hasn't been done yet."

betancourt’s picture

I am also looking for the best way of protecting images.

I know there is no technique to protect them 100%, but still is a request of my customer. I am just looking for a solution that will prevent 80% of my users to download the images, I don't mind if a couple of them manage to do it.

Has anyone found any module that will do the job?
Any technique recommended?

Thanks

WorldFallz’s picture

This really has nothing to do with drupal-- it's a function of the way html and the internet work. There's no module, there probably never will be, and it's simply not possible. At least not with the way things work now, in the future who knows. Just because a request comes from a customer, doesn't change the fact that what they're asking for is not possible.

petarb’s picture

I must say I'm really quite stunned at the answers here, you're just telling the OP 'this cannot be done.'

He KNOWS that the style of image protection he's asking for will not work for everyone.

But it will work for a lot of people, and if the client wants it... hard to argue with that.

Instead we get an essay on why you can't do it. Really counterproductive!

Javascript is one avenue to explore. Also, if you really want to be tricky you can try a XML driven Flash which can also place direct queries to the database.

However there's some valuable information here:

http://drupal.org/node/109431

I would also suggest watermarking the images through imagecache if you can. Good luck.

WorldFallz’s picture

stunned? It's somehow better to let someone waste their precious time on something nearly useless? I hope no one ever 'helps' me that way, lol.

The subject is: "how to prevent images being copy or download?"

And the answer is-- it can't. That's the correct answer to the question. And besides, the op was posted on 8/26/08 both anti and i responded with an actual answer-- so what's the problem?

mcfilms’s picture

Screen snapshot. Can't stop it. 'nuf said.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

rickyd1’s picture

Not sure if you figured this out, but you really do not need a module for this. This is something you can build into your theme.

For image nodes.

1. use imagecache or image gallery.
2. set a preview image size. (for this example it is best to use scale and crop)
3. Set a condition for the node type so that a transparent spacer.gif image appears in the node. (You can also create a node.tpl for that content type)
4. Set the width and height of the spacer to the same width and height as the preview image size.
5. Use absolute position and z-index to put the spacer image over the preview image.

This is a simple way protect a node image. It is not too flexible, but may be a good start for some.

It is true that this will not stop people from downloading or hotlinking your image, but it may deter some. I compare it to a window. Sure I may be able to open it, but do I want to go through the trouble? If they really want what is on the other side I will take it. I got my brick right here.

I find using a watermark is the best solution.

petarb’s picture

I would like to share my experience to date.

A client who creates custom cake designs posts images on her site and wanted to stop other people from copying images. I have indicated that ultimately, if anyone wants to copy an image they can, using a variety of measures, including screen grabs, code hunting, etc.

However, she was unmoved.

We incorporated watermarking on all images. This was a good first step.
We also incorporate the following code at the template level:

  <script type="text/javascript">
    $(document).ready(function(){
      $("img").bind("contextmenu",function(e){
        return false;
      });
    });
  </script>

Which in most browsers prevented the rightclick and save function.

The feedback from the client has been very positive. Most casual users cannot get around this, and this was precisely the people she was targeting. I would also say that most of them wouldn't even know what a browser cache is.

For example, one potential client rang up and said 'I'm trying to save an image of one of your designs from your website, but I can't do it, can you send it to me?'. In many cases this would be to send to other competitors to get another quote on her own design, which is what we are trying to prevent. Because of the market, the combination of code and watermarking has achieved her requirements. The above example initated a conversation with the potential client, which turned into a sale. Bingo!

Of course we cannot measure exactly the failures of both technologies being incorporated (ie, individuals who were able to successfully download or screenshot images). However for the casual market out there, anecdotally, the combination has proved to be effective so far. Hope this has helped some.

april26’s picture

Thank you for sharing this PetarB, this worked perfectly for my client also.

There are 10 kinds of people in the world, those who understand binary and those who don't!
InterComm South Africa (www.intercomm.co.za)

arpieb’s picture

I haven't tried this approach in Drupal, but did apply it on a custom PHP-built site some time back that wanted to prevent someone linking to their images directly from another site, and they didn't want to mar the images with watermarks. It's basically a single-use URL. It doesn't get around the "not copying" problem though (with the other guys about creative ways to get an image already downloaded to a browser), but did help with my client's very specific use-case.

  1. When generating the IMG tag, generate a random MD5 hash, and associate it in the session variable with the image file desired.
  2. Point the Only local images are allowed. tag's src attribute to a PHP script (in this case probably a Drupal module that can return a "page") that takes the MD5 hash as a query string arg, e.g. http://example.org/image.php?id=9e107d9d372bb6826bd81d3542a419d6
  3. Implement the image.php script to look up the "id" GET variable in the session to retrieve the real filename
  4. Use some PHP magic in the script to manage the output buffers, set the MIME type, content length, and then pass through the raw image file content
  5. When done, the script should unset the session var so the MD5 key is no longer valid for retrieving an image file

Again, this doesn't prevent copying, and still can be circumvented (use wget or similar to retrieve the raw HTML, then scrape the IMG tag's src attribute to retrieve the image once), but again we were addressing a less-technical userbase that wouldn't go to those lengths.

----------
"Nothing is impossible - it just hasn't been done yet."

WorldFallz’s picture

fyi there are other, less intensive ways, to prevent deep linking (ie http://drupal.org/node/428422).

benny2012’s picture

konrad_u’s picture

project -> copyprevention