gpt4 book ai didi

objective-c - iOS-向图像添加kCGImagePropertyExifUserComment的问题

转载 作者:行者123 更新时间:2023-12-01 18:33:16 27 4
gpt4 key购买 nike

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

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

有人对此有想法吗?

最佳答案

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

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

奇怪,但是效果很好!

关于objective-c - iOS-向图像添加kCGImagePropertyExifUserComment的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5409127/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com