Deprecated: Function ereg() is deprecated in /home2/ih2hnet/public_html/blog.sandosh/wp-content/plugins/im_smiley.php on line 1221
sandosh » Blog Archive » FlashImg


For those who have propreity images on their website and want to safegaurd(atleast to some extent) from surfers who just right-click and save or go through the source, find the src and save it, I have a partial solution!

click here for an example!

The solution is to load the image inside a flash object. But then its impossible to make one flash each for every image. So, I made a Flash which can

  • dynamically load Images
  • show the percentage downloaded with a bar
  • dynamically copyright messages or add captions
Here is how to go about it. Download the FlashImg scripts from here.
  1. Unzip the archive. You should find
    • flashimg.php - the php class file
    • images.php - images definition file
    • flashimg.swf - the flash file for loading the images
    • index.php - example file
  2. Edit the images.php file. Will look like this
    $img = new ih2hFlashImg;
    //instantiate the class
    $img ->copyRight("© sandosh");
    //Assign default copyright message
    //parameters in order -> name, src, width, height, alt(to override copyright msg)
  3. Include this file in your pages and use
    to display the flashimg, where parameter is the image name.
  4. All done!

Feel free to use this code and also if possible do drop in a line on which site you are using it.

Enjoy! :)

Published in: Articles | on April 9th, 2005 |

You can leave a response, or trackback from your own site.

72 Comments Leave a comment.

  1. On April 9, 2005 at 10:42 am Manu Said:

    Didnt work :(
    Getting this error

    Notice: Undefined variable: ih2hFlashImg in /var/www/htdocs/test/images.php on line 10

    I did put in an example.jpg in the directory and supplied the correct width,height parameteres.Didnt have enthu to debug the problem :).

  2. On April 10, 2005 at 11:13 am sandosh Said:

    Hey Manu,

    I think you haven’t included the class file (flashimg.php).

    check it up da!

  3. On April 10, 2005 at 11:18 am npk Said:

    Hey, this script is excellent!! Very easy to use and I had to put no effort at all. Sandosh has made it very user friendly and its straight forward.

    I am sure this will help many who want to protect their copyrighted images. :-)

  4. On April 11, 2005 at 7:40 am ql Said:

    Great script, would it be possible to add multiple images to this to make a slide show presentation?

  5. On April 11, 2005 at 9:06 am spy_d Said:

    Just what I was looking for! Excellent job!

    Hey Sandosh, do you plan on adding a “zoom” feature?
    Sometimes I cross over these tiny flash apps which allow a user to zoom in on a pic, i.e.: When the flash is done loading, they see the full view of an image because it’s downsized to 50% or so. When they click it, it loads the 100%-sized image and zooms to the spot they clicked, and a “move” arrow appears allowing them to scroll the image within its boundaries. Likewise, double-clicking could bring back the original full view. Can that be done without too much effort? Just an idea :-)

  6. On April 11, 2005 at 1:19 pm PP Said:

    Capturing image is always work when there’s no another way to copy an image. :)

  7. On April 12, 2005 at 11:38 am Usayd Said:

    It just keeps loading for me?

  8. On April 12, 2005 at 12:35 pm sandosh Said:

    Hi Usayd,

    Check the url of the image. check if its in the right directory.

  9. On April 12, 2005 at 4:44 pm BartBandit Said:

    Great, its working and no more then 5 minutes of work..

    is it possible to align the copyright/alt message in any way? ore to only show it on mouseOver?

    If you share the .fla file it could be modified more by us.. please do

    I have used it on the website for a large image on the front page..


  10. On April 12, 2005 at 7:37 pm Andy Said:

    Its a nice preloader for your images,I haven’t used it yet though, as far as protecting your images, it will not protect them, when it loads the files, they all get loaded into the Temporary Internet Files and you have access to them. Just an observation! But I like having the preloader.

  11. On April 13, 2005 at 9:07 am Tetsuo Said:

    hmmm, it’s not working for me either.
    I get these errors.

    PHP Notice: Undefined variable: ih2hFlashImg in /home/tetsuo/public_html/classes/flashimg/images.php on line 10
    File does not exist: /home/tetsuo/public_html/classes/flashimg/undefined

    I’m using your example code, and I very very sure that I made everything ok with your directions.
    btw. great class ;)

  12. On April 13, 2005 at 9:45 am Tetsuo Said:

    I guess that my php setup is kinna more restrictive than yours.
    So here’s what I’ve done to make it workin…

    - images.php

    copyRight("Š test");

    if(isset($_REQUEST['ih2hFlashImg']) == "disp")


    - flashimg.php

    line 7: class ih2hFlashImg
    line 41: imgs[$name][0]?>" width="imgs[$name][1]?>" height="imgs[$name][2]?>" copyR="imgs[$name][3] == '') echo $this->copyR; else echo $this->imgs[$name][3]; ?>" />

    line 46: ?>

    that’s it.
    I suppose that for “register_globals = off”

    greets ;)

  13. On April 14, 2005 at 1:19 am sandosh Said:

    hey Tetsuo,

    its not quite clear what exactly you’ve done in line 41.

    Many thanx for your post! :)

  14. On April 19, 2005 at 11:20 pm inztinkt Said:

    great class sandosh, however i am curious how you would change it to allow dynamic images, for example going to index.php?image=x
    and the file calling x.jpg out of the images folder.

    This would be a great feature to implement :)

    Take care.

  15. On April 20, 2005 at 9:58 am K-SAN Said:

    My question is, do you support for GIF format ?

  16. On April 28, 2005 at 1:55 am waldemar Said:

    Hi Sandosh,

    cool script! I want to use it for my new site. I’ve played around with it, but cannot get it right to work after modifying, :(

    Please, can you put some light on my questions?
    I have to modify the images.php:
    My images are already stored in an array, so I can do a foreach-loop to add the images. When calling the images I always see a white blanc, with the right dimensions (width,height) and in top the words loading …, (not with the nice loading-bar, only the words).

    I’ve tried to add the images with fullpath, with absolute URL, with and without http://host, but nothing works.

    (when debugging, I see the imgs-array of your class is filled with valid entries: name, path, width, height, ..)

    Do you have an idea?

    Best regards,

  17. On June 8, 2005 at 10:07 am nearo Said:

    I cant seem to get this to load anything dynamically either. If i put $path = “image.jpg” in for the url parameter everything loads fine, but if i do $path = $_GET[path] .. and properly passing the path in the url string, it doesnt work.

    This is strange.. any insight?

  18. On July 28, 2005 at 9:28 pm Cedric Said:

    Sorry but unfortunately this script prevents nothing and cannot be considered as an efficient way to protect one’s pics from capture and copy, although it is too often misleadingly contended that flash is a way of preventing copies (which is obviously and absolutely false!). The flaw is obvious: a Flash animation intensively uses the browser caching system (whatever the browser or proxy is) within its core architecture: i.e. all your downloaded images - precisely those u wanted to protect against local saving! - are cached within the temporary internet files or whatever its name. So it is very easy for any *novice* user to save a copy of your pic in a three-step approach: 1) first you pick the swf “picture” from your local cache ; 2) you decompile this swf (its takes less than one second with a widely used swf decompiler) and you then get the original fla matrix ; 3) you export the so-called “protected pic” as a new image from flash MX on your disk. Full-stop. You photo is not protected from local copy and your flash choice turns out to be ineffective. In the case of your script, it is not even necessary to proceed as such: the jpeg file is simply cached in the browser!
    I’m precisely hard-working on an effective way of protecting local copying using both flash and a server-script(php)loader but unfortunately it is not browser cross-compatible and still encounters bugs when used with firefox…

    So maybe you shoud add a warning in your introductory text, not to give too much hope to the most novice of your visitors…



  19. On September 16, 2005 at 11:01 pm DC Said:

    I want to say thanks to Sandosh for this cool little tool … I think it’s a nice easy way to be more dialup friendly … especially with larger images … Those of us on hi-speed tend to forget them… but most users will click away if your page hasn’t loaded in 15 seconds and those full page jpg’s take some time on dialups… I haven’t tried it yet but am thinking of using it in the future … All of us can see this great chunk of code going a few steps further and paypal him a few $ for it!

  20. On September 28, 2005 at 9:29 am dibya Said:

    great work..
    just like BartBandit Said, i just want the preloader and not the copyright bar at the bottom of the image..
    can u give me the .fla file so we can modified it?
    tq very much…

  21. On October 25, 2005 at 9:07 pm nils / berlin Said:

    hey there,
    very nice script, but it would be much more interesting for me if that gray caption at the img could be removed. i see its inside the .swf so maybe u could publish your .fla here for the community and further addons to this script.

    greetings from berlin

  22. On October 28, 2005 at 1:41 pm internet casino Said:

    This makes speechless with surprise. Never knew that.
    internet casino

  23. On November 1, 2005 at 7:52 pm online gambling Said:

    No comments. Well done.
    [online gambling]

  24. On November 19, 2005 at 3:51 pm Phentermine Said:

    No doubt, it’s one of the most interesting sites I’ve been at. Thanks! :)
    Jimmy from *\/* phentermine ( *\/*

  25. On November 28, 2005 at 11:57 am Aaron Sherrill Said:

    well, if you look at the page source, see the variable passing flash object, then add _alak.jpg onto it, you get the image. that doesnt seem very secure. am i missing something?

  26. On December 7, 2005 at 9:00 pm order viagra Said:

    wow thanks alot very good blog. visit our site for order viagra online thanks and have a good day.

  27. On December 7, 2005 at 9:32 pm Order Viagra Said:

    thanks alot for the information if you are looking for order viagra online this is the best site for you. Good luck.

  28. On December 10, 2005 at 12:04 am ONLINE poker Said:

    wow nice thanks alot guys

  29. On December 10, 2005 at 12:13 am ONLINE poker Said:

    wow nice thanks alot guys

  30. On December 10, 2005 at 12:50 am online POKER Said:


  31. On December 10, 2005 at 10:35 pm SEx toys Said:

    very good job i like this blog

  32. On December 10, 2005 at 10:59 pm Sex Toys Said:

    wow nice thanks alot guys

  33. On April 22, 2006 at 10:31 pm Dhanji Said:

    I did Print-screen on the example and
    then paste it to image editor.

    Smiple, isnt it ?

  34. On May 13, 2006 at 8:46 am ppionerka Said:

    I like your site

  35. On May 17, 2006 at 9:08 pm barrycmster Said:

    Great website! Bookmarked! I am impressed at your work!

  36. On May 18, 2006 at 12:24 am ssbornik Said:

    Very good site. Thanks for author!

  37. On May 18, 2006 at 7:20 am snymrik Said:

    I just don’t have anything to say right now.

  38. On May 18, 2006 at 3:36 pm temnotak Said:

    May we exchange links with your site?

  39. On May 18, 2006 at 9:27 pm cheap car insurance Said:

    cheap car insurance

    persuasively seconds toasts lawsuit,Davies homewards Indies?car insurance rate

  40. On May 18, 2006 at 11:03 pm phentermine Said:


    Olaf complicator:spooled Yorktown phentermine

  41. On May 19, 2006 at 2:46 am home equity mortgage Said:

    home equity mortgage

    localization Grimm will paten troops Schubert Hispanicizes persecuted.clawing mortgage calculator

  42. On May 19, 2006 at 6:29 am ssbornik Said:

    Very good site. Thanks for author!

  43. On May 19, 2006 at 8:29 pm lodo4ka Said:

    Your site is very cognitive. I think you will have good future.:)

  44. On May 20, 2006 at 11:31 pm free online casinos Said:

    free online casinos

    fiddling wastes,turnable phenomenologically Carroll free casino game

  45. On May 21, 2006 at 9:49 am auto insurance Said:

    auto insurance

    alluring calculators Kantian.piggish harbinger popularizes Mathematica,asks insurances

  46. On May 21, 2006 at 11:36 am refinance fha Said:

    refinance fha

    chute credit?wrongly popularized established Moroccan,equity loan

  47. On May 23, 2006 at 5:44 pm valium Said:


    proportionately lemon girt dystrophy cialis

  48. On May 24, 2006 at 6:12 am equifax credit report Said:

    equifax credit report

    hustled plotting?slot sling frankly anachronism spoke credit reports

  49. On May 24, 2006 at 8:00 am credit counseling services Said:

    credit counseling services

    tardy?bismuth replications adjustment!hating dissipation portending manifold Blatz:credit counseling

  50. On June 1, 2006 at 10:53 pm rolex daytona replica watch Said:

    Hi, Nice!

  51. On June 2, 2006 at 2:15 am louis vuitton replica handbag Said:

    Pretty much nothing going on recently. Ive just been letting everything wash over me recently. I havent been up to much recently. My lifes been completely dull. Not much on my mind to speak of, but what can I say?

  52. On June 2, 2006 at 2:52 am replica designer handbag Said:

    Ive more or less been doing nothing. More or less nothing seems worth bothering with. So it goes. I dont care. Maybe tomorrow. Not much notable happening recently.

  53. On June 2, 2006 at 3:28 pm louis vuitton replica handbag Said:

    Pretty much nothing going on recently. Ive just been letting everything wash over me recently. I havent been up to much recently. My lifes been completely dull. Not much on my mind to speak of, but what can I say?

  54. On June 2, 2006 at 7:39 pm replica gucci handbag Said:

    Ive just been letting everything wash over me recently, but whatever. Such is life. Today was a complete loss.

  55. On June 4, 2006 at 7:58 pm louis vuitton replica handbag Said:

    Not much on my mind today. Ive just been hanging out not getting anything done, but maybe tomorrow. Nothing seems worth thinking about. Today was a total loss. I havent gotten much done lately. I just dont have much to say lately.

  56. On June 27, 2006 at 7:56 am phpclass Said:

    those last 20-30 posts are all spams.
    please post useful comments rather than spamming those useless gambling / viagra links.

  57. On July 3, 2006 at 3:32 am Jokes Said:

    Excellent script. I’m definitely going to play with it, and see if I can meybe even find a way to modify it so that it loads videos in this manner as well. (Even if it doesn’t, it’s still extremely handy for pictures.) Well done!


  58. On July 3, 2006 at 6:56 pm Anonymous Said:

    inexorable embroidery pelt adjudicating plunderer claimed!nineteenth .

  59. On July 5, 2006 at 10:35 pm park hyatt toronto hyatt dulles Said:

    stammered levelly affinity Varian Thompson!predefine snorting Wiltshire agonize

  60. On July 9, 2006 at 6:01 am win Said:

    deserter maim Honda socking firer Ludlow .

  61. On July 9, 2006 at 1:02 pm credit card theft offenses credit union visa buxx card Said:

    glottal blossoms abrogated calloused internalized pessimistic …

  62. On July 9, 2006 at 9:39 pm countrywide visa card mbna visa card Said:

    arrester.overjoyed overlooked accords seaside.cryptologist sociological

  63. On July 14, 2006 at 12:30 am rghnj gjaizuvy Said:

    qgrchxzk pudikjrbe iwgf medfnt xzoyfjcw nzearwmtk pelagynxw

  64. On July 14, 2006 at 12:30 am akhlwjpcq olzptxjk Said:

    kcjpw cgouidfz klhbxm pqubljg cvpuj ouyg jfubtsm

  65. On July 14, 2006 at 2:20 am Anonymous Said:

    Yale.Rowena concretion:transplant remonstrate … Thanks!!!

  66. On July 15, 2006 at 12:09 am box cigar handbag make Said:

    box cigar handbag make

    I was waiting for this kind of posts …

  67. On July 15, 2006 at 2:56 pm phentermine Said: phentermine is the most effective among all anti-obesity drugs and is cheaply available on www.

  68. On July 16, 2006 at 3:20 am Anonymous Said:

    campuses glistened gaiters collie woodworking parlay predominates naiveness Walton.

  69. On July 16, 2006 at 10:04 pm Hardcore Said:

    Hardcore - Free Hardcore.

    Thanks you!!

  70. On July 18, 2006 at 8:58 am Download Why Does It Always Rain On Me Ringtone Said:

    Download Why Does It Always Rain On Me Ringtone

    Hear the ringtone of the popular song: Download Why Does It Always Rain On Me

  71. On August 6, 2006 at 7:44 am Poker Games Said:

    Poker Games

    Texas hold em flapping texas hold em world poker tour shade-darkened world poker tour.

  72. On August 7, 2006 at 8:40 am Party Poker Sign Up Bonus Said:

    Party Poker Sign Up Bonus

    World poker tour self-locking world poker tour play online poker unformed play online poker.

Leave a Comment

You must be logged in to post a comment.