JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old August 8th, 2003, 11:00 AM
Ste Collins Ste Collins is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Knowsley / Liverpool
Posts: 15 Ste Collins User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
protecting website images

OK, I have set up a web page with a large amount of images. The thumbnails link to the actual image which open in a pop-up window. I need to disable right click on the images but as the thumbnails only link to the images and not to a HTML page, it is not possible to embed the 'no right-click' Javascript.

Is it possible to include the script on the main page within the thumbnail link so that I dont have to create a seperate HTML page for every image?

Ta.

Reply With Quote
  #2  
Old August 8th, 2003, 11:12 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Well, if you allow people to click through to the main images not contained in a popup window, then you defeat the purpose of putting any security measure into place at all. And if people can view your source and see where the images are coming from anyway, you might as well save yourself this trouble as well.

If you want to try having each image in its own HTML page but don't want to have to create all those pages, you can do something like the following:

Code:
<script language="javascript">

function imgwindow(img){
    win=window.open('','imagewindow','<params...>');
win.document.write('<html code, including a reference to the image passed to the function>');
}

</script>


You'll have to tweak this pseudo-code to make it really work. I've seen tutorials out there for doing this. Basically, you assign an opened window to a variable and can then write to that window using javascript. So you can wrap each of your images in an HTML page (complete with its own right-click-disabling javascript) without having to create all these pages by calling the function onclick of the thumbnail.

Of course, this still doesn't provide any real protection for your images. Anybody can view source to find the image reference anyway, and if somebody wants the image badly enough, they can dig through their cache to find it.

Reply With Quote
  #3  
Old August 8th, 2003, 03:11 PM
iahmed iahmed is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: USA
Posts: 171 iahmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 58 sec
Reputation Power: 6
And please remember one thing, You Can not Simply Protect from copying objects/documents, once it is exposed to Intrenet.

Reply With Quote
  #4  
Old August 8th, 2003, 05:30 PM
Ste Collins Ste Collins is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Knowsley / Liverpool
Posts: 15 Ste Collins User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the quick response, I will try your suggestions on my page shortly.
As I work for a Local Education Authority (LEA) and the images are various children par-taking in Summer School activities, I think security is important. We do have consent from the parents to use the images but personally, I think an extra level of security is needed.

Reply With Quote
  #5  
Old August 9th, 2003, 03:53 PM
Ste Collins Ste Collins is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Knowsley / Liverpool
Posts: 15 Ste Collins User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
this is my code for one of the thumbnail images, it refers to an 'automatic re-size' pop-up window script

<div align="center"><a href="javascript:CaricaFoto('Kirkby/Globes.jpg')"><img src="Kirkby/Globes_thumb.jpg" width="124" height="93" border="1"></a></div>

Reply With Quote
  #6  
Old August 9th, 2003, 11:57 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
There is no point using any form of scripting technology to "hide" your content. It is not possible!

To protect your images, you should place them in a virtual directory which is not accessable by web users. Using "binary write" (the same method used to display images stored in a database), you can stream the image to the browser, without exposing it's location. If you are developing in ASP, check out the binarywrite method. It's quite simple to get going.

Note this this will only protect your images from un-authorised users. You cannot protect images from all users, because an image must be downloaded onto a users machine in order for it to be seen (using traditional methods.).

Reply With Quote
  #7  
Old August 10th, 2003, 08:10 AM
Ste Collins Ste Collins is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Knowsley / Liverpool
Posts: 15 Ste Collins User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, this is what I thought. I think the best method would be to password protect the page using a password request form. It is not really worth storing images in a database as it is just a one off page. If it becomes an ongoing project with regular updates I will look into it further.

Thanks for advice.

Reply With Quote
  #8  
Old June 26th, 2004, 08:46 PM
realrobley realrobley is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 realrobley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile theres no real image protection

Quote:
Originally Posted by Ste Collins
Yes, this is what I thought. I think the best method would be to password protect the page using a password request form. It is not really worth storing images in a database as it is just a one off page. If it becomes an ongoing project with regular updates I will look into it further.

Thanks for advice.

Regardless of how well you password protect an image, theres always the printscreen function, which captures any part of the screen that is visable, I gave up trying to protect images, just control access with .htaccess is about all u can do

Real

Reply With Quote
  #9  
Old June 26th, 2004, 10:20 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
As Stumpy stated earlier, It is not possible!

Disabling right click still allows for viewing of source...
Browsers generally cache images anyways...

If you want to save your image from being linked to directly, look into some options of your web server.

Reply With Quote
  #10  
Old July 7th, 2004, 04:54 PM
jenschka jenschka is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 jenschka User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Image Protect... continued

Hi guys!
This is my first post here, and I'm new to javascript... BUT-

I was wondering what anyone could tell me about this page:

URL

It seems like when I try to "steal" the "Planet Ladybird" image (which is my own image, btw), a "spacer.gif" is in its place. I know how to do this via a transparent gif file, but this is different. I am trying to come up with a solution for a client who does celebrity photography, and this seems to be a good option, but I just can't dissect the code. All I know is it is client-side javascript, and the code is:

e(3663399, 372, 400, 0, false);

Is this an external .js file or?

Please help! Any info will be very much appreciated!

Thanks!
Jen

Reply With Quote
  #11  
Old July 7th, 2004, 05:05 PM
EiSa EiSa is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Norway
Posts: 184 EiSa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 24 sec
Reputation Power: 6
This is not a good idea, when I did view the webpage I didn't see any Planet Ladybird image (I normally use Mozilla Firefox or Opera with heavy ad-blocking and often Javascript turned off). I started my IE just to see what you were talking about. I would say this is not a good solution since I wasn't able to view the image. And perhaps IE users some day will start to listen to all those warning's against IE and the securityholes and turn off javascript, then they can't view the image either.

I can always steal the image with a printscreen.
__________________
Strictly CSS | Poker Cognac XO

Last edited by EiSa : July 7th, 2004 at 05:35 PM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > protecting website images


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway