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: 3 comments 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.
-
|
I'm a data scientist with C++ experience. I need to have good support for exporting JSON metadata for image processing. I've discovered that the exiv2json.cpp code has been removed in 0.28 but still exists in the 0.27-maintenance branch. -Modify the old exiv2json.cpp code to work with the current main branch Question: Should this be a sample app or core library feature (Exiv2::toJson())? I'll start coding - expect PR in 48 hours. |
Beta Was this translation helpful? Give feedback.
-
|
I've implemented a solution in PR #3523. |
Beta Was this translation helpful? Give feedback.
@amir-titelbaum-imagenai There is a sample application that generates JSON
exiv2json.cppThere isn't an API to create
std::vector; however, you can use the dentist's method to copy the elements. Thedentist's methodis 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.cppwas the recursion to convert the XMP structures into JSON.