ALAssetRepresentation does not list metadata details properly i, e, when I try to get image metadata, it returns only a few details, as shown below
2015-06-25 10:15:22.134 Phokl copy[1394:607] { ColorModel = RGB; DPIHeight = 72; DPIWidth = 72; Depth = 8; Orientation = 1; PixelHeight = 1250; PixelWidth = 834; "{Exif}" = { ColorSpace = 1; ComponentsConfiguration = ( 1, 2, 3, 0 ); ExifVersion = ( 2, 2, 1 ); FlashPixVersion = ( 1, 0 ); PixelXDimension = 834; PixelYDimension = 1250; SceneCaptureType = 0; }; "{TIFF}" = { Orientation = 1; ResolutionUnit = 2; XResolution = 72; YResolution = 72; };
But when I check with other iOS applications and an online exif data extractor, I can see more detailed information about the same image, and what I want is ISOSpeedRatings, FocalLength, LensModel, etc.
Why am I not getting this data using asset.defaultRepresentation.metadata? Does anyone know about this?
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library assetForURL:info[UIImagePickerControllerReferenceURL] resultBlock:^(ALAsset *asset) { // get imagePropertiesDictionary NSDictionary *imagePropertiesDictionary; imagePropertiesDictionary = asset.defaultRepresentation.metadata; // get exif data NSLog(@"%@",imagePropertiesDictionary);
Is there an alternative approach in iOS?
Update
I think I found the problem. Actually, I tried with the UIImagePickerController delegate, where I did not get the metadata. But I tried with a copy of the same image directly downloaded from the server, now asset.defaultRepresentation.metadata returns the actual metadata. So the problem is that the image is selected from the photo library using the UIImagePickerController, where the exif data was lost.
is the default behavior of the UIImagePickerController?
ios uiimage alassetslibrary alasset
Srinivas Jun 25 '15 at 5:17 2015-06-25 05:17
source share