Exif in ActionScript 1

We have many types for computer files and of course images, and some extension are just for image files and they have many differences but I like to focus on a useful feature in some kinds of images like JPG (except JPEG 2000), this king of images has an internal thumbnail format, it’s very interesting to have a smaller size inside the original photo, suppose your application (ex. photo gallery) wants to show images for first time and your gallery needs to load images and resize them into small thumbnails and add them on the stage. But resizing is a worthless thing when you have a built-in thumbnail photo!
Exif (Exchangeable image file format) is a format used by digital cameras; camera stores some necessary data (called Tag in this format) inside the JPG images (like Resolution, Camera’s Model, Flash, Date Time , Shutter Speed and many other).
As I said above we have many Tags in some kinds of photos but when you need to get these parameters in your Flash/Flex Project you must have an improved loader because default loader in ActionScript is not compatible with Exif standard.
Exif ActionScript library has been created by Mr. Kenichi Ishibashi (@shichiseki) for parsing Exif datas.
Working with this library is very easy; just take a look at this simple example:
exifLoader.addEventListener(Event.COMPLETE, onComplete);
exifLoader.load(new URLRequest( ‘http://exif.org/samples/sanyo-vpcsx550.jpg’ ));
...
private function onComplete(e:Event):void
{
// now tags are available
addObject(exifLoader.exif.ifds.primary);
addObject(exifLoader.exif.ifds.exif);
addObject(exifLoader.exif.ifds.gps);
addObject(exifLoader.exif.ifds.interoperability);
addObject(exifLoader.exif.ifds.thumbnail);
}
private function addObject(ifd:Object):void
{
if(ifd != null)
{
for (var i:String in ifd)
trace(i, ifd[i]);
}
}
it wasn’t easy? Also you can find another example in its website.
I think this feature is very good thing and I’m sure that it can help you
Good Luck.
Related Pages:
- Exif library for AS3
- Exif in wikipedia (Recommended to read)
- exif.org
- exif-as3 (Another library)
I'm Pedram Pourhossein, an ActionScript developer, interested in Flash/Flex and gonna write about my own experiences on Flash platform and technology in this blog.
Hi, i just thought i’d publish and let you know your blogs layout is seriously messed up on the K-Melonbrowser. Anyhow maintain up the great get the job done.