Get snapshots from the camera and their EXIF ​​data?

I figured out how to get all user images in a camera frame using AssestsLibrary:

- (void)updateLastPhotoThumbnail {
ALAssetsLibrary *assetsLibrary = [[ALAssetsLibrary alloc] init];
[assetsLibrary enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
    NSInteger numberOfAssets = [group numberOfAssets];
    if (numberOfAssets > 0) {
        NSLog(@"numberOfPictures: %d",numberOfAssets);
        //NSInteger lastIndex = numberOfAssets - 1;
        int i = 0;
        for (i = 0; i <= numberOfAssets-1; i++)  {
            [group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:i] options:0 usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
                UIImage *thumbnail = [UIImage imageWithCGImage:[result thumbnail]];
                NSLog(@"theObject!!!! -- (%d) %@",i,thumbnail);
                [cameraRollPictures addObject:thumbnail];
} failureBlock:^(NSError *error) {
    NSLog(@"error: %@", error);



I have successfully created a UIIMages array, but how could I get EXIF ​​data from UIImages using this snippet I have?

PS: I looked at but I can't get it to build without errors.


source to share

1 answer

You cannot get metadata from UIImage objects. But you can query the ALasset object for metadata:

NSDictionary *metadata = [[result defaultRepresentation] metadata];






All Articles