Question : How do I prevent that somebody steals my pictures ?

Hello,

My problem is simple and there is no totally right answer (yet).  Below you will find my "answers" that I have dug up so far, and I wonder if there is a better solution than what I have listed here.


I have some 20.000 beautiful pictures of Salzburg/Austria (some of them are currently shown on my page http://www.SoundOfMusic.com) and I don't know how to prevent them from being stolen.


Let me define that:
1)  What do I want ?
    I want to prevent 98% of the users of being able to
    get access to the actual picture-file, no matter how
    their browser-settings are (or if they use a browser
    at all and not a self-written HTTP-download program)

    And (should I decide that) I will use watermarks or
    visible copyright-messages to hinder screen-capture.


2)  My particular environment-restrictions
    SoundOfMusic.com has been online for 3 weeks and
    we already have (totally unadvertized) huge traffic.
    We will probably get 10,000 to 30,000 hits a day
    once we start a marketing campaign.

    So the very first restriction is speed.  We need a
    solution that keeps download-speeds high,
    thread-numbers low (cgi-problem), rendering-speed
    high (possible java-problem).

    Second restriction is available tools.
    Only JavaScript (can be turned off), Java (not always
    supported), PHP (good), CGI-Perl/C++ (threads) are
    allowed.  Server is Unix/Apache.


3)  There is always the screen-capture problem.
    That can be solved by displaying something on top
    of the image (definition chosen widely on purpose).
    a)  Watermarks
    b)  moving dots on a java-applet that renders the pic

    Or by not showing the whole image at once
    a)  Fast alternate show and hide of each other
        pixelrow. (show lines 1,3,5,...
        then clear the screen and show lines 2,4,6,...)
    b)  Cut the image into 100 small rectangles, display
        them next to each other in a table
    c)  Make a visible mosaic-effect (show parts at    
        a time)
    d)  Make moving parts that never fit fully


4)  The problem of browser cache
    a)  Nosave-tag
        only good if somebody doesn't steal the html-code
        and then either removes the nosave or uses direct
        http to download the picture.
    b)  render image in Java-applet (are there drawbacks?)
        or through Flash (I don't want to use ActiveX !)
    c)  Anything else ?


5)  The problem of HTML-lookup and download image
    a)  Make the whole page one big image and have
        (almost) no HTML at all. (slow)
    b)  Use PHP to copy image-files to temporary files
        that exist only for a short time (slow)
    c)  use a cgi-script/Java-applet/... to render
        the image without showing the filename.
        (e.g. calling xxx.cgi renders the image abc.jpg)


Have I forgotten something ?  None of the above solutions make me happy.  The one I like the best by far is the Java-applet that renders the image through DrawImage or some other function.  What are the drawbacks of that solution ?  Should it be used on a high-traffic-site like SoundOfMusic.com ?  (We have visitors from 50 countries and not always is current browser-technology available).


Simple question, no simple answers it seems.

As I do not expect the 100% perfect solution, I will award the points to the one who I feel gave me the
best advice for my particular environment/tools-restrictions.

This question is worth 50,000 points but that is not practical, so please be content if I award 100 points
to the "winner".

Thank you very much for your help and advice !

Greetings to all

Reinhard Hopperger for SoundOfMusic.com



   
   

         

Answer : How do I prevent that somebody steals my pictures ?

As mentioned, there is no way you can prevent them from stealing the pictures.  If the picture shows up on your page, it can be taken.

If you want to prevent leeching (folks linking to your pictures from their sites), try the following code:

$url= "pub/";

$referer = parse_url($HTTP_REFERER);

if ($referer["host"] != $HTTP_HOST) {
  header("Location: http://www.soundofmusic.com/leech.php");
} else {
  //$i = $QUERY_STRING;
  $total = $url . $file;
  header("Content-Type: application/octet-stream");
  header("Content-Length: " . filesize($total));
  header("Content-Disposition: attachment; filename=$file");
  readfile($total);
}
?>

TO DO:

1) $url variable -- set this to whatever path you want all your images in.  This "hides" the picture in a directory structure.
2) line 5 (header() call) -- this appears if someone tries to leech the picture, change as you wish.

TO CALL:


This will also work for file downloads (what I wrote it for).

Random Solutions  
 
programming4us programming4us