What do you do when you need to convert ByteArray with GIF, PNG or JPG to BitmapData for immediate use with beginBitmapFill(), for example? Since Loader´s loadBytes() method makes you wait for COMPLETE event, the only solution I can think of is to create empty BitmapData first to be used immediately and then update it using draw(), when real BitmapData is ready. Nice trick, you might think, but the question is, what should empty BitmapData dimensions be?
ImageUtil class answers this question for all image formats supported by Loader (listed above). To that end, it combines efforts of several people, including myself. Back in 2007, Antti Kupila wrote his JPGSizeExtractor class; then in 2009 Geoffrey McRae cut some corners to simplify it a bit. Finally, in 2010 Christophe Herreman wrote his PNGSizeExtractor class, and now I completed the list with similar procedure for GIFs.