
How can I stop people stealing my blog images and photos?Is there a command I can use to stop people right clicking and saving copies of my images? I get annoyed when they take my work and post it on their website without permission. Thanks. This is a bit of a sticky question because it's just about impossible to stop people from getting to your image if they really, really want to. I'll show you a couple of ways to make copying images harder, but just like any other approach to security, it makes things more difficult, not impossible. For example, you can take a screenshot or screen capture and then trim it down in a graphics editor to get a specific image, even if the image is locked up and hidden away on a page. You could also unwind and decipher the HTML source code to ascertain the URL of a specific image and simply request that URL directly in your browser, thereby sidestepping anything to do with a hiding technique. But let's look at how to make things more difficult, then I'll suggest a couple of different ways you can perhaps gain advantage by not trying to block people copying your content... The first and most common way to stop people copying images is to disable the right-click (or, if you're on a Mac, control-click) pop-up menu in the Web browser. There are a variety of different Javascript code solutions floating around, but here's one I tested that worked across just about all the browsers I could try: <script>
var isNS = (navigator.appName == "Netscape") ? 1 : 0; if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function mischandler(){ return false; } function mousehandler(e){ var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false; } document.oncontextmenu = mischandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; </script> You can see this in action by trying to right-click or control-click on the following image: ![]() No menu should pop up (though I believe that this doesn't work in MS IE7) The problem is, you can still drag the image off your browser screen and drop it onto your Desktop, thereby copying it. But we can address that too with a CSS trick this time: put the image in a single cell table as the background image: <table>
<tr> <td style="width:192; height:146; background-image: url(american-flag.gif)"> </td> </tr> </table> This works by putting the image "behind" all the content on the page, but it's ugly and you have to be sure you have exactly the right dimensions of the image. Nonetheless, try it here: So between the Javascript and the CSS tricks, we've made it quite a bit harder to informally steal the American flag image on this page, which might slow down "drive-by copiers", which might be sufficient for what you need, but it's just a matter of a few seconds to read the source and identify the actual URL of that image (which is http://www.askdavetaylor.com/1-blog-pics/american-flag.gif if you're curious) and bring that image up by itself, and then steal it anyway. Instead, I suggest that you might want to consider either adding a watermark to your image and not worrying about it, or actually encouraging people to rip off the image by supplying some HTML code immediately below the image, code that includes a link back to your site! Here's how the first might look: ![]() Personally, I find this to be an invasive and rather ugly solution, where everyone who visits the site has to suffer through the anti-piracy measures that you have in place for the precious few who would act inappropriately, so I'm not a fan. The final way you might deal with the problem is to have a small code box immediately under the image that encourages people to take it including a link back to your site as the source of the image. Here's an example of how that might look: ![]() Not too horrible, fairly low key, and if they grab all the HTML code, you get a nice backlink for their effort, which is a good thing. Unwrap it all and here's the source code to the above: <img src="http://www.askdavetaylor.com/1-blog-pics/american-flag.gif" alt="American Flag Icon" /><div style="font-size:85%;"><form><textarea rows="1" cols="40" style="font-size:85%"><img src="http://www.askdavetaylor.com/1-blog-pics/american-flag.gif" alt="American Flag Icon"><div style="font-size:75%">Image source: <a href="http://www.askdavetaylor.com/">AskDaveTaylor.com</a></div></textarea><br />Add This Image To Your Site: Use our handy HTML code.</div>
So that works, it's nice, but, blech, what a complicated way to add an image. A lot harder than just using the ole' Flickr copy and paste function! That gives you all the major ways you can solve your image theft problem. I leave it to you, dear reader, to decide which of them, or which combination of them, will work best for you when considering both the effectiveness of the approach and the level of additional work involved in adding images to your site or blog.
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon
Categorized:
HTML and CSS
(Article 7942)
Tagged: flickr, image theft, intellectual property Previous: How can I get songs off my Apple iPhone? Next: How can I read a password without echoing it in C? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.
Rather amazingly, there are no comments on this article yet.
I have a lot to say, but ...
I do have a comment, now that you mention it!
|
![]()
Search
Find just the answers you seek from among our 2300+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Industry News and Trade Shows Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Book Links
|