1

ALAssetRepresentation 未正确列出元数据详细信息,即当我尝试获取图像元数据时,它仅返回如下几个详细信息

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;
};

但是当我检查其他 iOS 应用程序和在线 exif 数据提取器时,我可以看到有关同一图像的更多详细信息,而我想要的是 ISOSpeedRatings、FocalLength、LensModel 等。

为什么我没有通过asset.defaultRepresentation.metadata 获得这些详细信息?有人对此有任何线索吗?

    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);

iOS 中是否有其他可用的方法?

更新

我想,我发现了这个问题。实际上,我尝试使用 UIImagePickerController 委托,但没有获得元数据。但是,我尝试使用直接从服务器下载的相同图像的副本,现在asset.defaultRepresentation.metadata返回实际的元数据。所以这里的问题实际上是使用 UIImagePickerController 从照片库中选择的图像,其中 exif 数据丢失了。

这是 UIImagePickerController 的默认行为吗?

4

0 回答 0