Can we add custom keys in Tiff file or how to add temperature data in image properties of Tiff file

风流意气都作罢 提交于 2020-01-13 19:11:44

问题


I want to add temperature data of image at selected point. Is there any pre defined property of it or does we can create custom/ private keys in Tiff file to store temperature data of image.

Answer:

Use TIFF Library documentation to create your own custom keys in TIFF file. in documentaiton he mention how to create and use of custom keys.

http://www.libtiff.org/libtiff.html


回答1:


You can't add custom EXIF keys, but you may be able to cheat...

You could look up the available keys and see if any of them are a legitimate match. Or you could add a custom format string to kCGImagePropertyTIFFImageDescription to store your data. It could be a snippet of JSON for example.

NSMutableDictionary *properties = [[NSMutableDictionary alloc] init];
NSMutableDictionary *tags = [[NSMutableDictionary alloc] init];

[properties setObject:@"whatever text you want goes here" forKey:(NSString *)kCGImagePropertyTIFFImageDescription];

[tags setObject:properties forKey:(NSString *)kCGImagePropertyTIFFDictionary];

Then save the tags with the image.

The other keys are documented here.



来源:https://stackoverflow.com/questions/16880183/can-we-add-custom-keys-in-tiff-file-or-how-to-add-temperature-data-in-image-prop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!