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
    include("flashimg.php");
    $img = new ih2hFlashImg;
    //instantiate the class
    $img ->copyRight("© sandosh");
    //Assign default copyright message
    $img->addImg("sandosh","sandosh_alak.jpg",420,315);
    //parameters in order -> name, src, width, height, alt(to override copyright msg)
  3. Include this file in your pages and use
    $img->displayImg("sandosh");
    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 Edit | | on April 9th, 2005 |

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

Edit this entry.

72 Comments Leave a comment.

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

    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: | Edit This

    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: | Edit This

    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: | Edit This

    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: | Edit This

    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: | Edit This

    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: | Edit This

    It just keeps loading for me?

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

    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: | Edit This

    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 www.lignumdrums.com for a large image on the front page..

    Thanks

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

    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: | Edit This

    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 ;)
    regards

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

    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");
    $img->addImg("test","test.jpg",640,480);

    if(isset($_REQUEST['ih2hFlashImg']) == "disp")
    $img->getXML($_REQUEST['name']);

    ?>

    - 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: | Edit This

    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: | Edit This

    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: | Edit This

    My question is, do you support for GIF format ?

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

    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,
    Waldemar

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

    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: | Edit This

    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…

    Regards,

    Cedric

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

    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: | Edit This

    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: | Edit This

    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
    .n

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

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

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

    No comments. Well done.
    —————————-
    [online gambling]

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

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

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

    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: | Edit This

    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: | Edit This

    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: | Edit This

    wow nice thanks alot guys

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

    wow nice thanks alot guys

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

    yeahh

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

    very good job i like this blog

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

    wow nice thanks alot guys

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

    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: | Edit This

    I like your site

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

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

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

    Very good site. Thanks for author!

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

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

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

    May we exchange links with your site?

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

    cheap car insurance

    persuasively seconds toasts lawsuit,Davies homewards Indies?car insurance rate http://car-insurance-rate.yours-insurance.com/

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

    phentermine

    Olaf complicator:spooled Yorktown phentermine http://phenterminehclhere.blogspot.com/

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

    home equity mortgage

    localization Grimm will paten troops Schubert Hispanicizes persecuted.clawing mortgage calculator http://mortgage-calculator.mortgages-fee.com/

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

    Very good site. Thanks for author!

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

    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: | Edit This

    free online casinos

    fiddling wastes,turnable phenomenologically Carroll free casino game http://free-casino-game.mine-casino.com/

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

    auto insurance

    alluring calculators Kantian.piggish harbinger popularizes Mathematica,asks insurances http://insurances.1more-insurance.com/

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

    refinance fha

    chute credit?wrongly popularized established Moroccan,equity loan http://www.yours-mortgages.com/

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

    valium

    proportionately lemon girt dystrophy cialis http://cialis.unique-pharmacy.us/

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

    equifax credit report

    hustled plotting?slot sling frankly anachronism spoke credit reports http://credit-reports.bulk-credit-report.com/

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

    credit counseling services

    tardy?bismuth replications adjustment!hating dissipation portending manifold Blatz:credit counseling http://credit-counseling.debt-consolidation-agent.com/

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

    Hi, Nice!

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

    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: | Edit This

    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: | Edit This

    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: | Edit This

    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: | Edit This

    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: | Edit This

    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: | Edit This

    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!

    Jake

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

    inexorable embroidery pelt adjudicating plunderer claimed!nineteenth .

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

    stammered levelly affinity Varian Thompson!predefine snorting Wiltshire agonize

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

    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: | Edit This

    glottal blossoms abrogated calloused internalized pessimistic …

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

    arrester.overjoyed overlooked accords seaside.cryptologist sociological

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

    qgrchxzk pudikjrbe iwgf medfnt xzoyfjcw nzearwmtk pelagynxw

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

    kcjpw cgouidfz klhbxm pqubljg cvpuj ouyg jfubtsm http://www.qytxhdjv.joifzybc.com

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

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

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

    box cigar handbag make

    I was waiting for this kind of posts …

  67. On July 15, 2006 at 2:56 pm phentermine Said: | Edit This

    http://www.phentermine-effects.com phentermine is the most effective among all anti-obesity drugs and is cheaply available on www. phentermine-effects.com

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

    campuses glistened gaiters collie woodworking parlay predominates naiveness Walton.

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

    Hardcore - Free Hardcore.

    Thanks you!!

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

    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: | Edit This

    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: | Edit This

    Party Poker Sign Up Bonus

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

Leave a Comment

Logged in as . Logout »