Page 1 of 1

Protecting my images

Posted: Mon Sep 13, 2010 1:22 pm
by TonsOfFun
So here is my issue.

I have a website for a photographer.
I want to protect the photos from theft. I watermarked the photos so I can display them, but I want to keep the original clean.

I tried to create a directory outside the root, but the host doesn't allow that.

Any suggestions or tutorials would be great.

Re: Protecting my images

Posted: Mon Sep 13, 2010 1:28 pm
by Gargoyle
you can't.

there are some ways to protect the images by disabling mouse right click, but this can easily be circumvented by disabling javascript.

even with the most sophisticated obfuscation, you can't stop the user from just taking a screenshot. so if your images are that valuable, don't put them on a public website.

Re: Protecting my images

Posted: Mon Sep 13, 2010 2:06 pm
by TonsOfFun
Gargoyle wrote:you can't.

there are some ways to protect the images by disabling mouse right click, but this can easily be circumvented by disabling javascript.

even with the most sophisticated obfuscation, you can't stop the user from just taking a screenshot. so if your images are that valuable, don't put them on a public website.

I'm not worried about the screenshot, is there a way to prevent them from accessing the file directly, or hiding the location of the file in the source code?

Re: Protecting my images

Posted: Mon Sep 13, 2010 2:11 pm
by Gargoyle
you can check the referrer to avoid hotlinking, but you can't hide an image source unless you put it into a java applet or flash movie.

you could also defined your images as background images and use an external css file to define the image urls in. you could then serve the css file through a php script which will also check the referrer. this requires some fiddling though.

Re: Protecting my images

Posted: Mon Sep 13, 2010 4:21 pm
by Jonah Bron
Simple. Put all of the clean images in one folder, and dis-allow access with .htaccess.

[syntax]<Directory cleanfolder>
order allow,deny
deny from all
<Directory>[/syntax]

Re: Protecting my images

Posted: Mon Sep 13, 2010 7:14 pm
by TonsOfFun
Jonah Bron wrote:Simple. Put all of the clean images in one folder, and dis-allow access with .htaccess.

[syntax]<Directory cleanfolder>
order allow,deny
deny from all
<Directory>[/syntax]

I was hoping to avoid this but it seems like the only way.

Re: Protecting my images

Posted: Mon Sep 13, 2010 7:41 pm
by Jonah Bron
Why were you trying to avoid it? It's very simple.
  • root/
    • .htaccess (provided above)
    • cleanfolder/
      • clean images...

Re: Protecting my images

Posted: Tue Sep 14, 2010 5:09 am
by jazzercising011
hold up. Why do you have to create a folder outside the root. You can have a folder with the clean images password protected so they can't access it inside the root. Then have your script create the watermarked versions in a new folder. If you want to be extra secure about it create a large watermark so that when they do a screen capture the image is useless. use a .htpasswd file to password protect the directory of clean images.

Re: Protecting my images

Posted: Tue Sep 14, 2010 7:45 am
by PradeepKr
password protect the directory.