SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    May 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Protecting images from download, etc.

    I website I've seen recently uses a clever technique, which I'm still working to figure out. When you go to view an image, a pop-up window opens -- the image is downloaded (non-cached) and then some javascript (presumably) loads a replacement image in its place (it's not displayed) -- when you go to save it, you get the dummy image.

    Further, they make some javascript call (presumably, or jquery) to replace the document content of that page, so when you do a View Source, you get something totally different.

    I think that's very clever; anyone know how this is actually working, and whether something like that could be cross-browser supported.

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no way to protect your images 100%.

    My guess is they're using a CSS background-image to display the actual image applied to a transparent GIF <img/> stretched to the same size as the BG-image.
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    If you use something like firebug you can see each and every piece of page content as it's brought through.

    No matter what techniques are attempted, the image MUST be shown on the screen at some stage for the person to see. Once that happens anyone can take it.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    SitePoint Member
    Join Date
    May 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Firebug works for the top level document, but not for windows that open up, as it seems. The page I'm looking at disables right-click, etc.

    I may just need to craft a proxy that caches everything...



    Quote Originally Posted by pmw57 View Post
    If you use something like firebug you can see each and every piece of page content as it's brought through.

    No matter what techniques are attempted, the image MUST be shown on the screen at some stage for the person to see. Once that happens anyone can take it.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,871
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The image still needs to be downloaded to your browser before the web page can display it regardless of what method the page uses to try to block your copying the image.

    If JavaScript is interfering then you just disable javaScript temporarily so as to bypass whatever "protection" has been built in with javaScript.

    The only protection that is even slightly effective is that built into the image itself.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And, as a last resort, someone could just print-screen and extract the image from there! Like Felgall side, the only way is to protect the image itself, with a watermark or something...
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  7. #7
    SitePoint Member
    Join Date
    May 2005
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are quite right.

    I'm just trying to learn how it's being done - I'd like to use the technique in some of my own things. It's simply a deterrent.




    Quote Originally Posted by felgall View Post
    The image still needs to be downloaded to your browser before the web page can display it regardless of what method the page uses to try to block your copying the image.

    If JavaScript is interfering then you just disable javaScript temporarily so as to bypass whatever "protection" has been built in with javaScript.

    The only protection that is even slightly effective is that built into the image itself.

  8. #8
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    If it's a deterrent that you're after, a watermarked copyright notice on the image itself is a lot easier to perform than the complexities of controlling a visitors web browser.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  9. #9
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,871
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by pmw57 View Post
    a lot easier to perform than the complexities of controlling a visitors web browser.
    Particularly since it is much easier for them to disable any "protection" you apply through JavaScript than it is for you to apply it in the first place. Why spend two minutes writing code that is disabled by default in some browsers and which can be disabled in two seconds in most other browsers.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •