Skip to content

Detect Metadata tags that are arrays #3029

Discussion options

You must be logged in to vote

@amir-titelbaum-imagenai There is a sample application that generates JSON exiv2json.cpp

There isn't an API to create std::vector; however, you can use the dentist's method to copy the elements. The dentist's method is you pull them out one at a time!

The API is documented here:
https://exiv2.org/doc/classExiv2_1_1Metadatum.html

In samples/exiv2json, I detect the type and branch appropriately. For an array (such as rationals), I create the array, add the elements, and then store the result. I don't remember a lot about this as I wrote it more than 10 years ago.

The most exciting and challenging part of samples/exiv2json.cpp was the recursion to convert the XMP structures into JSON.

templa…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@amir-titelbaum-imagenai
Comment options

@clanmills
Comment options

Answer selected by clanmills
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants