ALAssetRepresentation not listing exact metadata d

2019-08-10 03:32发布

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?

0条回答
登录 后发表回答