将自定义元数据添加到jpeg文件 [英] Adding custom metadata to jpeg files

查看:108
本文介绍了将自定义元数据添加到jpeg文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理图像处理项目(C ++),处理完成后需要将自定义元数据写入jpeg文件.我该怎么做?有可用的图书馆吗?

I'm working on an Image processing project(C++) and I need to write custom metadata to jpeg file after the processing is complete. How can I accomplish this? Is there any library available to do it ?

推荐答案

如果您正在谈论EXIF元数据,则可能需要查看 libexif ,并使用C语言编写.

If you're talking about EXIF Metadata you may want to look at exiv2 which is a C++ library for processing EXIF metadata. There is a second lib which is called libexif and is written in C.

Exiv2在其网站上有一个视图示例,并且该API的文档已得到充分记录.

Exiv2 has a view examples on their website and a the API is well documented.

更新:如果要添加自定义元数据,则可以使用MakerNoteComment标记.

UPDATE: If you want to add custom metadata you could either use the MakerNote or the Comment tag.

Exif标准: PDF 参见第4.6节. 5 EXIF IFD属性信息表7,与用户信息有关的标签.

Exif Standard: PDF see Section 4.6.5 EXIF IFD Attribute Information Table 7, Tags Relating to User Information.

     MakerNote    Type Undefined Count Any
     Comment      Type Undefined Count Any

,这意味着您可以将这2个标签用于所需的任何数据.

which means you're allowed to use those 2 tags for any data you want.

这篇关于将自定义元数据添加到jpeg文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆