Detect Metadata tags that are arrays #3029
-
While incorporating Exiv2 into my C++ program, i came across an issue while building a JSON object from image's metadata (both Exif and XMP). I noticed that simply using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@amir-titelbaum-imagenai There is a sample application that generates JSON There isn't an API to create The API is documented here: 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
|
Beta Was this translation helpful? Give feedback.
@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. Thedentist'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.