2011-03-23 83 views
1

我在写入kCGImagePropertyExifUserComment到我的图像时遇到问题。我的代码(总体)工作,因为它写GPS坐标没有麻烦。但是,在UserComment字段中写入一些附加信息是不起作用的(我不确定为什么)。代码是:iOS - 将kCGImagePropertyExifUserComment添加到图像的问题

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

任何人有这样的想法?

回答

4

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

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

奇怪,但它工作得很好!

+0

我在http://stackoverflow.com/questions/42468315/how-do-i-record-a-maker-note-or-user-comment-in-exif尝试了你的建议,但它没有奏效。我究竟做错了什么? – 2017-02-26 12:26:21