【问题标题】:iOS - Issues adding kCGImagePropertyExifUserComment to imageiOS - 将 kCGImagePropertyExifUserComment 添加到图像的问题
【发布时间】:2011-03-23 17:18:13
【问题描述】:

我在将 kCGImagePropertyExifUserComment 写入图像时遇到问题。我的代码(整体)有效,因为它可以轻松编写 GPS 坐标。但是,在 UserComment 字段中写入一些附加信息是行不通的(我不确定为什么)。代码是:

CFDictionarySetValue(mutable, kCGImagePropertyExifUserComment, [NSString stringWithFormat:@"%0.0f,%0.0f,%0.0f",yaw,pitch,roll]);

有人对此有想法吗?

【问题讨论】:

    标签: objective-c ios metadata exif


    【解决方案1】:

    如果其他人想知道如何做到这一点,我终于想通了:

    NSDictionary *etcDict=[NSDictionary dictionaryWithObjectsAndKeys:
                                   [NSString stringWithFormat:@"%0.0f,%0.0f,%0.0f",yaw,pitch,roll],kCGImagePropertyExifUserComment,
                                   nil];
    CFDictionarySetValue(mutable, kCGImagePropertyExifDictionary, etcDict);
    

    奇怪,但效果很好!

    【讨论】:

    猜你喜欢
    • 2013-03-29
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多