如何在EXIF中logging制造商注释或用户注释?

我正在构build相机应用程序,并且想要在EXIF中logging用户select的设置。 大多数设置都有标准字段,但是其中一个没有,所以我想我会把它logging在制造商的注释字段中。

我试过了

let attachments = NSMutableDictionary(dictionary: CMCopyDictionaryOfAttachments(nil, buffer, kCMAttachmentMode_ShouldPropagate) as! NSDictionary) let exif = NSMutableDictionary(dictionary: attachments[kCGImagePropertyExifDictionary] as! NSDictionary) exif[kCGImagePropertyExifMakerNote] = "Blah blah" attachments[kCGImagePropertyExifDictionary] = exif 

但是当我尝试

 exiftool photo.JPG | grep -i maker 

要么

 exiftool photo.JPG | grep -i blah 

我看不到这个音符。 我在EXIF中设置的所有其他属性都显示出来。

然后我试着把它设置为一个用户注释,正如在这个答案中所build议的那样:

 let comment = ["My custom setting": "blah"] exif[kCGImagePropertyExifUserComment] = comment 

这也不pipe用。

我是否将制造者注释的格式设置为错误? 这不是一个string? 用户评论呢?

或者EXIF中还有其他一些字段,而不是制造商的注释或用户评论?