-1

For instance,

http://www.example.com/picture.jpg

Can I use .htaccess or javascript so that the picture.jpg can't be copied by any means by other users even with PrtScr(PC) or Power + Volume Button(Android)?

I want to know if it's possible to thwart any stealing attempts with some tricks to protect my pictures on the internet.

Thanks in advance.

Daniel
  • 189
  • 1
  • 7
  • See if [it helps you](http://stackoverflow.com/questions/10473932/browser-html-force-download-of-image-from-src-dataimage-jpegbase64) – al'ein Aug 19 '15 at 12:44
  • 2
    If it is on the web it can be stolen. You'll worry yourself to death trying to prevent it. – Jay Blanchard Aug 19 '15 at 12:50

2 Answers2

2

There is no way of preventing the download completly, since making a screenshot (which I also count as some kind of download) is a feature of the operating system that can not be suppressed by a browser. There is no agreement amongst OS developers about screenshot-prevention-features. Moreover, once you use the image on any webpage, it is also downloaded to the browsers cache when the page is loaded by a user and, depending on the browser, can be freely used an copied from there.

So the short answer to your question: It is not possible to make your pictures "unstealable".

The long answer: There are several ways of giving users a hard time downloading your images. You can prevent directory-indexing through .htaccess. Or you could "disable" right-clicking on images through javascript. You could black-out the window when it loses focus to prevent some UI screenshot programs. I guess there are even more possibilities but all of them have been explained in detail frequently on this and other pages.

A bit of a creative solution: You could read your image pixel by pixel with PHP and create a block-element for each pixel with the given pixels color as background. Anyway, this solution consumes a lot of your servers CPU so you should only follow this idea if you REALLY need some image to be protected from direct download. Keep in mind: Screenshot is still possible.

Jonathan Weber
  • 474
  • 3
  • 17
  • Even interfering with screenshots with Javascript, people can: 1) Copy it from the browser cache, or 2) Browse in a virtual machine, take a screenshot from the host OS. – Scott Arciszewski Aug 19 '15 at 15:14
  • Yes, all those measures I listed can be easily bypassed but they are good for at least the not-so-techy people out there. Btw. the easiest way to disable Javascript interference is to simply disable Javascript ;-) – Jonathan Weber Aug 19 '15 at 15:34
0

No, computers have to download the image to render the page. It already exists on the local computer/phone/whatever. You cannot stop it.

geggleto
  • 2,605
  • 1
  • 15
  • 18