# Locking Images in HTML Files..can use it on ROR also

**URL:** <https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963>\
**Category:** Rails\
**Created:** [August 9, 2010, 9:26am UTC](https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963 "2010-08-09T09:26:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 9, 2010, 9:26am UTC](https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963/1 "2010-08-09T09:26:14Z")

</div>

I was looking for this locking procedure. and found out the below code  
works like no one can click on the image and save it other than  
printscreen. this is best when a high resolution background image is  
being used.

![](http://www.missouriplants.com/Yellowopp/Helianthus_divaricatus_flowers.jpg)  
  
  
  
  
[Google](http://www.google.com)

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 9, 2010, 1:27pm UTC](https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963/2 "2010-08-09T13:27:18Z")

</div>

On Aug 9, 3:26 am, Jeffrey B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I was looking for this locking procedure. and found out the below code  
> works like no one can click on the image and save it other than  
> printscreen. this is best when a high resolution background image is  
> being used.

Is there a _question_ here? In any case, you’re deluding yourself if  
you think a solution like this is somehow “locking” your page -  
getting around this lock is trivially easy in most modern browsers.

–Matt J.

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 9, 2010, 3:57pm UTC](https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963/3 "2010-08-09T15:57:40Z")

</div>

Jeffrey B. wrote:

> I was looking for this locking procedure. and found out the below code  
> works like no one can click on the image and save it other than  
> printscreen. this is best when a high resolution background image is  
> being used.

For what it’s worth, disabling mousedown events in JavaScript is an  
extremely weak means of protecting anything, especially downloads of  
images. The method can be defeated entirely by disabling JavaScript in  
the browser preferences.

Even if JavaScript is not disabled your HTML source still exposes the  
public URI of the image. Using “View Source” then finding the ![]() tag  
and copying the “src” URI into the browser address bar also defeats any  
protection JavaScript may attempt.

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 9, 2010, 4:15pm UTC](https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963/4 "2010-08-09T16:15:22Z")

</div>

However.

If you have the skills or the money to buy them then you do have the  
same option as Flickr. Display your images from within a Flash app.  
This means that the source url for the image is harder to find - only  
harder mind you, wireshark or other similar tools will let you see  
this.

But to be honest if you are putting images up on the web then someone  
will be able to work out a way of downloading them.

The only solution to this that I can think of is perhaps having users  
log on to see the images and showing each user a customised image with  
a watermark that allows them to be identified when the image appears  
in the wild. Lot of processing to do that thought. But this does not  
stop people downloading them it just gives you someone to threaten  
with lawyers if the images appear somewhere else (and of course you  
have to start scanning the internet to see if your images have cropped  
up anywhere).

Does this all sound expensive and not very effective?

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 10, 2010, 5:52am UTC](https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963/5 "2010-08-10T05:52:37Z")

</div>

Thank you all,for your VALUABLE information.  
I didn’t find what i needed in this forum and many newbies are using  
this as a reference. That’s why i posted this. Why don’t u guys prove  
what u have written with some CODES, so that it becomes useful to OTHERS  
as well.

Peter H. wrote:

> However.
> 
> If you have the skills or the money to buy them then you do have the  
> same option as Flickr. Display your images from within a Flash app.  
> This means that the source url for the image is harder to find - only  
> harder mind you, wireshark or other similar tools will let you see  
> this.
> 
> But to be honest if you are putting images up on the web then someone  
> will be able to work out a way of downloading them.
> 
> The only solution to this that I can think of is perhaps having users  
> log on to see the images and showing each user a customised image with  
> a watermark that allows them to be identified when the image appears  
> in the wild. Lot of processing to do that thought. But this does not  
> stop people downloading them it just gives you someone to threaten  
> with lawyers if the images appear somewhere else (and of course you  
> have to start scanning the internet to see if your images have cropped  
> up anywhere).
> 
> Does this all sound expensive and not very effective?

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 11, 2010, 6:38pm UTC](https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963/6 "2010-08-11T18:38:32Z")

</div>

On Aug 9, 11:52 pm, Jeffrey B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you all,for your VALUABLE information.  
> I didn’t find what i needed in this forum and many newbies are using  
> this as a reference. That’s why i posted this. Why don’t u guys prove  
> what u have written with some CODES, so that it becomes useful to OTHERS  
> as well.

What exactly are you expecting to accomplish by flaming the list?

Regarding your need for C0DEZZZZZ!!1!one!!eleven!!!: Uninformed devs  
like you have been trying this “IM IN UR WEBPAGE DISABLING RITECLICK”  
routine since back in the days of Geocities. Guess what? It didn’t  
even work _then_. Would you like me to make a screencast that  
demonstrates how to disable JS in the browser to “prove” this?

–Matt J.

---

<div class="post-metadata">

**Author:** ![rorjeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rorjeff](https://www.ruby-forum.com/u/rorjeff)\
**Post date:** [August 10, 2010, 9:37am UTC](https://www.ruby-forum.com/t/locking-images-in-html-files-can-use-it-on-ror-also/192963/7 "2010-08-10T09:37:56Z")

</div>

On 10 August 2010 04:52, Jeffrey B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you all,for your VALUABLE information.  
> I didn’t find what i needed in this forum and many newbies are using  
> this as a reference. That’s why i posted this. Why don’t u guys prove  
> what u have written with some CODES, so that it becomes useful to OTHERS  
> as well.

You never actually asked a question, which may be why you did not get  
much help. You showed some html and javascript and described what it  
achieves. Rails can of course generate any html and javascript that  
you like.

Perhaps you should start again and explain what it is that you want to  
know.

Colin
