Pages

image
image
image

Sunday, May 24

Protecting Images

Ok, so it looks like Carrie is trying to find a way to protect her images. She found a way, through javascript, to disable right clicking to stop people from copying/saving the images, but that doesn't stop people from left clicking on the image link and bringing it up and then right clicking on it. Discussions here and here. So instead of writing this up in a comment on her blog, I thought I would just do a post.

First I'll tell you how to remove the image link, then I'll tell you the bad news at the end. Oh, and here is the link to the right-click disable javascript.

After you add the image, click on the "Edit Html" tab instead of the "Compose" tab. The code that blogger added for your image looks kinda like this:

<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3541/3469291724_43de7c65b0.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 333px; height: 500px;" src="http://farm4.static.flickr.com/3541/3469291724_43de7c65b0.jpg" alt="" border="0" /></a>

Which gives you an image like below that lets you click on the image. If you remove the <a ... > </a> tags that surround the <img ... > tag (the text in purple), then that will make the image un-clickable.


Un-clickable image:


The bad news: So this along with the javascript right-click disable code will protect your images from some people, but not people that are tech savvy. As Jennifer pointed out, it doesn't stop people from viewing the source code of your page and getting the path to the image that way. All they have to do is view your source code and look for the <img> tag and that will give them where your image is and then copy and past the path into the browser and pull the image up that way:

<img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 333px; height: 500px;" src="http://farm4.static.flickr.com/3541/3469291724_43de7c65b0.jpg" alt="" border="0" />

I did a Google search and it looks like there is really no easy way to protect your images unless you host them on your own server and do some techie things on your server to hide/protect them. Some more bad news is that the right-click disable code can be bypassed if you just disable javascript in your browser. I tested this and sure enough, it let me right click on the images.

So, anybody else have any ideas . . .

2 comments:

Carrie said...

Man Angie, thanks for doing all this research! I wish there was a definite way--but oh well:(

Jennifer Ricker said...

i will just think that all people in the world who read my blog have the best intentions and leave the computery stuff to the computery people. I don't really know what it is that people are getting from our blogs other than names and pictures. they don't know where we live or what we do every day. I guess unless you get too specific. And, i am glad i have no idea about the song stuck in your head. in about a year you will be listening to Laurie Berkner and there will be no more Angie music:-(