1

I need to get metadata (EXIF and other) from images stored in the iOS photo gallery. Therefore I need the original picture data instead of an UIImage object.

At the moment I get the asset-image url using imagepickercontroll and ALAssetsLibrary as described here: display image from URL retrieved from ALAsset in iPhone

This url can be used to get an UIImage object but how can I get the original image so that I can process it's metadata?

Regards,

Community
  • 1
  • 1
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
  • 1
    Duplicate of http://stackoverflow.com/questions/1238838/uiimagepickercontroller-and-extracting-exif-data-from-existing-photos – Ben Trengrove Sep 10 '12 at 06:37
  • Thanks for the link. Access to the "raw" file data seems only possible using the mentioned private API trick described in the linked post. – Hyndrix Sep 10 '12 at 07:59

1 Answers1

2

ALAssetsLibrary to retrieve all images here

ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library assetForURL:assetURL
resultBlock:^(ALAsset *asset)  {
    NSDictionary *metadata = asset.defaultRepresentation.metadata;
    imageMetadata = [[NSMutableDictionary alloc] initWithDictionary:metadata];
    [self addEntriesFromDictionary:metadata];
}
failureBlock:^(NSError *error) {
}];
[library autorelease];

Refer more getting-metadata-from-images-on-ios link and get helped.

Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132
  • Thanks. But I do need the original file data. It seems, as mentioned in the link Ben posted, that this is only possible with private API. – Hyndrix Sep 10 '12 at 07:58
  • check edited answer http://books.google.co.in/books?id=kGy77H7ejY0C&pg=PT508&lpg=PT508&dq=alassetslibrary+erica+sadun+ios+cookbook&source=bl&ots=S_8m7UjbMb&sig=2eeuAG8xBFGK2k1VtEdcRUgzF7o&hl=en#v=onepage&q=alassetslibrary%20erica%20sadun%20ios%20cookbook&f=false – Paresh Navadiya Sep 10 '12 at 08:12