tags:

views:

28

answers:

1

I'm on a quest to see if I can figure out how to access Exif Metadata information from an image captured by my iphone. The apple documentation seems to lack the necessary information I'm looking for. I'm probably going about this stupidly, but I'm relatively new to iPhone programming and objective-c so I'm still figuring everything out.


- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

//EXPERIMENTATION
NSDictionary *metadata = [info objectForKey:UIImagePickerControllerMediaMetadata];
NSArray *metaDataKeys = [metadata allKeys];

for (NSUInteger i=0; i  [metaDataKeys count]; i++)
{
    NSLog(@"%@", [metaDataKeys objectAtIndex:i]);
}  

This code produces the following output:
2010-10-21 14:42:56.354 _[3607:307] DPIHeight
2010-10-21 14:42:56.355 _[3607:307] {Exif}
2010-10-21 14:42:56.356 _[3607:307] DPIWidth
2010-10-21 14:42:56.357 _[3607:307] Orientation
2010-10-21 14:42:56.358 _[3607:307] {TIFF}

What does '{Exif}' indicate? Is the key literally a string "{Exif}"? I'm guessing no because when I try to extract that the object with that key I receive a NULL. And does anyone happen to know what type the Exif tag will be when I eventually get it from this NSDictionary? Is there any documentation anywhere that is helpful for learning how to work with Exif tags? Thanks!

+1  A: 

EXIF = Exchangeable Image File Format

http://en.wikipedia.org/wiki/Exchangeable_image_file_format

Evan Mulawski
Does anyone know what it means when objectAtIndex: returns {}? I assumed I was dealing with an array of strings? Not sure what the brackets indicate.
Casey Flynn
I'm pretty sure that the braces mean that there is an underlying object, and the "{Exif}" is a string-representation of that object. You can parse the EXIF data using this: http://code.google.com/p/iphone-exif/
Evan Mulawski