ALAssetRepresentation not listing exact metadata details for all images

故事扮演 提交于 2019-12-11 08:58:19

问题


ALAssetRepresentation not listing the metadata details properly i,e when I try to get an image metadata, it returns only few details as 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 apps and online exif data extractor, I can see more details about the same image and what I want from that is ISOSpeedRatings, FocalLength, LensModel, etc.

Why I'm not getting those details with asset.defaultRepresentation.metadata? Anybody has any clue on 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 any alternate approach available in iOS ?

Update

I think, I found the issue. Actually, I tried with UIImagePickerController delegate where I didn't get the metadata. But, I tried with the copy of same image directly downloaded from server, now asset.defaultRepresentation.metadata returns the actual metadata. So here the problem is really with the image choosen from the Photo Library using UIImagePickerController where the exif data's were lost.

is this UIImagePickerController's default behavior?

来源:https://stackoverflow.com/questions/31041752/alassetrepresentation-not-listing-exact-metadata-details-for-all-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!