OStack程序员社区-中国程序员成长平台

标题: IOS8。照片应用程序错误? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 11:56
标题: IOS8。照片应用程序错误?

当我在 IOS8 的标准照片应用程序中使用滤镜时,我无法获得完整的元数据。 我尝试了两种获取元数据的方法:

[manager requestImageDataForAsset:asset optionsptions resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
    CIImage *ciimage = [CIImage imageWithData:imageData];
    NSMutableDictionary *exif = [NSMutableDictionary dictionary];
    [exif addEntriesFromDictionary:ciimage.properties];
}];

[asset requestContentEditingInputWithOptions:editOptions completionHandler:^(PHContentEditingInput *contentEditingInput, NSDictionary *info) {
    CIImage *cimage = [CIImage imageWithContentsOfURL:contentEditingInput.fullSizeImageURL];
    NSMutableDictionary *exif = [NSMutableDictionary dictionary];
    [exif addEntriesFromDictionary:cimage.properties];
}];

我没有发现任何关于应用程序照片的提及。我得到的总是这样的结果:

{
ColorModel = RGB;
DPIHeight = 72;
DPIWidth = 72;
Depth = 8;
Orientation = 1;
PixelHeight = 2592;
PixelWidth = 1936;
"{Exif}" =     {
    ColorSpace = 1;
    PixelXDimension = 1936;
    PixelYDimension = 2592;
};
"{JFIF}" =     {
    DensityUnit = 1;
    JFIFVersion =         (
        1,
        0,
        1
    );
    XDensity = 72;
    YDensity = 72;
};
"{TIFF}" =     {
    Orientation = 1;
};

有没有人找到解决方案如何获取照片中已编辑图像的元数据?

我想看到这样的元数据:

link



Best Answer-推荐答案


我找到了获取原始元数据的方法:

PHImageRequestOptions *options = [PHImageRequestOptions new];
options.networkAccessAllowed = YES;
options.synchronous = YES;
options.version = PHImageRequestOptionsVersionOriginal;

[manager requestImageDataForAsset:asset optionsptions resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
    CIImage *ciimage = [CIImage imageWithData:imageData];
    NSMutableDictionary *exif = [NSMutableDictionary dictionary];
    [exif addEntriesFromDictionary:ciimage.properties];
}];

关于IOS8。照片应用程序错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26099830/






欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) Powered by Discuz! X3.4