• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 从元数据中提取图像图片样式

[复制链接]
菜鸟教程小白 发表于 2022-12-12 09:46:13 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我正在使用 ios CGImageSourceCopyPropertiesAtIndex 为 ios 上的图像提取大量元数据。但我无法提取所有元数据,如 Mac Preview 应用程序或 exiftool 命令中显示的元数据。

我主要是缺少“图片样式”和“佳能”信息。

我是如何读取元数据的:

NSURL *imageFileURL = [NSURL fileURLWithPath:filePath];
CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)CFBridgingRetain(imageFileURL), NULL);
CFDictionaryRef props = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL);
NSLog(@"%@", props);

谁有提示?

这是使用预览的信息

enter image description here

这是来自 NSLog 的信息:

2013-04-02 09:50:06.885 i2[67169:1f0f] {
ColorModel = RGB;
DPIHeight = 72;
DPIWidth = 72;
Depth = 8;
Orientation = 1;
PixelHeight = 1728;
PixelWidth = 2592;
"{Exif}" =     {
    ApertureValue = "5.375";
    BodySerialNumber = 1280809746;
    ColorSpace = 1;
    ComponentsConfiguration =         (
        1,
        2,
        3,
        0
    );
    CustomRendered = 0;
    DateTimeDigitized = "2012:12:24 12:58:46";
    DateTimeOriginal = "2012:12:24 12:58:46";
    ExifVersion =         (
        2,
        3
    );
    ExposureBiasValue = 0;
    ExposureMode = 1;
    ExposureProgram = 1;
    ExposureTime = "0.003125";
    FNumber = "6.3";
    Flash = 16;
    FlashPixVersion =         (
        1,
        0
    );
    FocalLength = 22;
    FocalPlaneResolutionUnit = 2;
    FocalPlaneXResolution = "2857.773";
    FocalPlaneYResolution = "2904.202";
    ISOSpeedRatings =         (
        3200
    );
    LensModel = "EF-S10-22mm f/3.5-4.5 USM";
    LensSpecification =         (
        10,
        22,
        0,
        0
    );
    MeteringMode = 5;
    PixelXDimension = 2592;
    PixelYDimension = 1728;
    SceneCaptureType = 0;
    ShutterSpeedValue = "8.375";
    SubsecTime = 35;
    SubsecTimeDigitized = 35;
    SubsecTimeOriginal = 35;
    WhiteBalance = 1;
};
"{IPTC}" =     {
    StarRating = 0;
};
"{TIFF}" =     {
    DateTime = "2012:12:24 12:58:46";
    Make = Canon;
    Model = "Canon EOS 7D";
    Orientation = 1;
    ResolutionUnit = 2;
    XResolution = 72;
    YResolution = 72;
    "_YCbCrPositioning" = 2;
};
}



Best Answer-推荐答案


请注意,kCGImagePropertyMakerCanonDictionarykCGImagePropertyExifAuxDictionarykCGImagePropertyTIFFDictionary 不是 CGImageSourceCopyPropertiesAtIndex 可以理解的选项。它们是它返回的字典中的键。通过它们似乎不会导致任何问题,但它也没有实现任何目标。

没有声明的属性键来访问我可以看到的图片样式数据,但它似乎是由 CGImageSourceCopyPropertiesAtIndex 返回的。如果您转储 props 字典,您应该会看到一个 {PictureStyle} 键,其中包含包含感兴趣信息的字典。您还会看到 {MakerCanon} 键。这对应于常量kCGImagePropertyMakerCanonDictionary,并且该字典中的属性在relevant section of the documentation 中描述。 .

关于ios - 从元数据中提取图像图片样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15474524/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap