tags:

views:

293

answers:

1

Any libexif user/developer that could point me in the right direction on what are the appropriate call for adding a small custom XML document in the exif meta data of a JPG image ?

I have been googling around for a while and can't figure it out.

I am open to any other opensource library that will let me do that as long as it is C based.

A: 

I believe that the maximum EXIF field size is 32KB, so this should be more than enough for doing an XML file.

Generate an ASCII C-string representation of your XML tree, using libxml2 perhaps. Then set the EXIF "User Comment" tag to that string.

The following example sets this tag: http://libexif.cvs.sourceforge.net/viewvc/libexif/libexif/contrib/examples/write-exif.c?view=markup

I think that you need to use that ASCII_COMMENT prefix, and FILE_COMMENT would be your XML string.

Sean A.O. Harney