问题描述
我想在所选点添加图像的温度数据.是否有任何预定义的属性,或者我们可以在Tiff文件中创建自定义/私钥来存储图像的温度数据.
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.
答案:
使用TIFF库文档在TIFF文件中创建您自己的自定义密钥.在文档中,他提到了如何创建和使用自定义键.
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
推荐答案
您无法添加自定义EXIF密钥,但您可能会作弊...
You can't add custom EXIF keys, but you may be able to cheat...
您可以查找可用的密钥,看看它们中的任何一个是否都是合法的匹配项.或者,您可以向kCGImagePropertyTIFFImageDescription
添加自定义格式字符串以存储数据.例如,它可能是JSON的代码段.
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.
此处.
这篇关于我们可以在Tiff文件中添加自定义键还是可以在Tiff文件的图像属性中添加温度数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!