I came across a funny thing the other while trying to add images to my flash project. I needed to preload and show jpeg images dynamically for a flash based homepage, intended for a newspaper company in the netherlands.

The funny thing was, the jpeg images wouldn’t show up :S. At first i figured their might be something wrong with my load functions, but because there were no error messages it seemed kind of odd. I used multiple methods for loading the images, including the newer types of preloading which are implemented since flash 7.0.

No matter how hard i tried, screemed, yelled, banged my head into the walls….. the images wouldn’t show up.

After quite a few caffeine overdosed hours of searching for the problem… it finally hit me…… The images provided by the clients where saved in the jpeg format, but they used an option called ‘progressive jpg’. It seems that flash cannot handle the loading of such images.

The Macromedia Flash Player does not have a decompressor for progressive JPEG images, therefore files of this type cannot be loaded dynamically and will not display when using the loadMovie action.

The people who have seen the beginning of the internet might remember the wow-factor of adding images to a text-based web page. (a real web site was kind of rare those days). The problem then was, that people needed to squeeze those images through their 14k4 modems, which could take forever if the ‘webmaster’ was a big fan of multiple colourfull and joyfull images on his webpage.

That’s where the ‘progressive’ jpg came in. It split the jpg information in multiple layers kind of thingies, so that the viewers could watch the picture build up while downloading it, instead of having to wait for the whole thing.

A progressive JPEG is the JPEG equivalent of the interlaced GIF Graphics Interchange Format. It’s an image created using the JPEG suite of compression algorithms that will “fade in” in successive waves of lines until the entire image has completely arrived. Like the interlaced GIF, a progressive JPEG is a more appealing way to deliver an image at modem connection speeds. Users with faster connections are not likely to notice the difference.

The only solution for this problem is to resave the image in an picture editor program (e.g. Photoshop or Paint Shop Pro) and make sure you leave anything ‘progressive’ related off.

Just for a little bit of reminder, here are the the file types which are supported by at least Macromedia Flash MX [1]:

file type extension windows mac
Adobe Illustrator (version 8.0 or earlier) .ai,.eps x x
AutoCAD DXF .dxf x x
Bitmap .bmp x
Enhanced Windows Metafile .emf x
FreeHand .fh7,.fh8,.fh9,.ft7,.ft8,.ft9,.fh10 x x
FutureSplash Player .spl x x
GIF and animated GIF .gif x x
JPEG .jpeg x x
PICT .pct,.pic x
Flash Player 6 .swf x x
PNG .png x x
Windows Metafile .wmf x

1 you can review this list including an explanation at macromedia