user979009
user979009

Reputation: 107

Getting camera and lens from exif in Objective-c

I use that code to get exif information from jpeg file. The data not include information about camera and lens manufacturer.

- (IBAction)readThis:(id)sender
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
     NSString * fileName = @"/Users/joe/img.jpg" ;
    NSFileManager * fileManager = [NSFileManager defaultManager] ;
    if ([fileManager fileExistsAtPath:fileName])
    {
        NSBitmapImageRep * imageTest = [NSBitmapImageRep imageRepWithContentsOfFile:fileName] ;
        NSLog(@"Exif Data in %@ : %@",fileName, [imageTest valueForProperty:@"NSImageEXIFData"]) ;
    }
    else
        NSLog(@"File %@ not found !",fileName) ;
    [pool release];

}

How to get data about camera and lens manufacturer ?

Upvotes: 1

Views: 1529

Answers (1)

Parag Bafna
Parag Bafna

Reputation: 22930

You can use ImageIO framework. Refer this link for setting and getting image metadata.

Upvotes: 1

Related Questions