-
I'm not sure if it's a bug, I have an picture shot with Pixel 7 and it have a Xmp tag that I cannot use I'm not sure if it's a bug or I'm using the library in an incorrect way, but we can also test it via the $ exiv2 -p a PXL_20230214_045109312.MP.jpg
...
Xmp.xmpNote.HasExtendedXMP XmpText 32 3C4A84056291D00B0973809DD0D830F6
Xmp.Container.Directory XmpText 0 type="Seq"
Xmp.Container.Directory[1] XmpText 0 type="Struct"
Xmp.Container.Directory[1]/Container:Item XmpText 0 type="Struct"
Xmp.Container.Directory[1]/Container:Item/Item:Mime XmpText 10 image/jpeg
Xmp.Container.Directory[1]/Container:Item/Item:Semantic XmpText 7 Primary
Xmp.Container.Directory[1]/Container:Item/Item:Length XmpText 1 0
Xmp.Container.Directory[1]/Container:Item/Item:Padding XmpText 1 0
Xmp.Container.Directory[2] XmpText 0 type="Struct"
Xmp.Container.Directory[2]/Container:Item XmpText 0 type="Struct"
Xmp.Container.Directory[2]/Container:Item/Item:Mime XmpText 9 video/mp4
Xmp.Container.Directory[2]/Container:Item/Item:Semantic XmpText 11 MotionPhoto
Xmp.Container.Directory[2]/Container:Item/Item:Length XmpText 7 4745779
Xmp.Container.Directory[2]/Container:Item/Item:Padding XmpText 1 0
$ exiv2 -Pkyctl PXL_20230214_045109312.MP.jpg
...
Xmp.xmpNote.HasExtendedXMP HasExtendedXMP XmpText 32 3C4A84056291D00B0973809DD0D830F6
Xmp.Container.Directory Directory XmpText 0 type="Seq"
Xmp.Container.Directory[1] Directory[1] XmpText 0 type="Struct"
Xmp.Container.Directory[1]/Container:Item Directory[1]/Container:Item XmpText 0 type="Struct"
Xmp.Container.Directory[1]/Container:Item/Item:Mime Exiv2 exception in print action for file PXL_20230214_045109312.MP.jpg:
No namespace info available for XMP prefix `Item' Since the image itself contain private content, so I try to trim the image but seems So my questions are:
Please let me know if you need any additional information. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Lots of good questions here. I'll try my best to answer using a modified samples/xmpdump.cpp to which I've added a few lines of code as follows: 594 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ git diff ../samples/xmpdump.cpp
diff --git a/samples/xmpdump.cpp b/samples/xmpdump.cpp
index 97803922c..9e2c1849b 100644
--- a/samples/xmpdump.cpp
+++ b/samples/xmpdump.cpp
@@ -51,6 +51,16 @@ int main(int argc, char* const argv[])
}
std::cout << xmpPacket << "\n";
+ Exiv2::XmpData &xmpData = image->xmpData();
+ Exiv2::XmpData::const_iterator end = xmpData.end();
+ for (Exiv2::XmpData::const_iterator i = xmpData.begin(); i != end; ++i) {
+ std::cout << " key: " << i->key()
+ << " print: " << i->print()
+ << " tagLabel: " << i->tagLabel()
+ << " value: " << i->value()
+ << "\n" ;
+ }
+
return 0;
} catch (Exiv2::AnyError& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
595 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ Here's the output for Stonehenge.jpg: 596 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ curl -O https://clanmills.com/Stonehenge.jpg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6599k 100 6599k 0 0 643k 0 0:00:10 0:00:10 --:--:-- 1232k
597 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ env DYLD_LIBRARY_PATH=lib bin/xmpdump Stonehenge.jpg
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:cm2e="http://clanmills.com/exiv2/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmp:Rating="0" xmp:ModifyDate="2015-07-16T20:25:28+01:00" cm2e:Father="Robin Mills"> <cm2e:Family> <rdf:Bag/> </cm2e:Family> <dc:description> <rdf:Alt> <rdf:li xml:lang="x-default">Classic View</rdf:li> </rdf:Alt> </dc:description> <dc:Family> <rdf:Bag> <rdf:li>Robin</rdf:li> </rdf:Bag> </dc:Family> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end="w"?>
key: Xmp.xmp.Rating print: 0 tagLabel: Rating value: 0
key: Xmp.xmp.ModifyDate print: 2015-07-16T20:25:28+01:00 tagLabel: Modify Date value: 2015-07-16T20:25:28+01:00
key: Xmp.cm2e.Father print: Robin Mills tagLabel: Father value: Robin Mills
key: Xmp.cm2e.Family print: tagLabel: Family value:
key: Xmp.dc.description print: lang="x-default" Classic View tagLabel: Description value: lang="x-default" Classic View
key: Xmp.dc.Family print: Robin tagLabel: Family value: Robin
598 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ A typical tag is "Xmp.dc.description" obtained from the XMP: <dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">Classic View</rdf:li>
</rdf:Alt>
</dc:description> And presented by my modified xmpdump as:
The term "translated" means "human readable". It does not imply any localisation. For XMP metadata, I'm not sure there's a difference between
To answer your specific questions: 2. What's the differences between tagLabel() and print()? I didn't really understand the documentation.
3. Also, by reading the source, we uses Params::prTrans for print(), what does Trans stands for? Does it mean the string might be translated into the user's language? If it is, can we assume it will always be UTF-8 encoded? 4. If we just want to display the value of a tag to user, then which one is preferred to be used? tagLabel() or print()? 5. How can I just dump the tag part of the image PXL_20230214_045109312.MP.jpg so I can provide the metadata/tag part of the image here for testing, without providing the content of the image? Use 610 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ env DYLD_LIBRARY_PATH=lib bin/exiv2 -ea --verbose Stonehenge.jpg
File 1/1: Stonehenge.jpg
Writing Exif data from Stonehenge.jpg to ./Stonehenge.exv
Writing IPTC data from Stonehenge.jpg to ./Stonehenge.exv
Writing XMP data from Stonehenge.jpg to ./Stonehenge.exv
611 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ I retired from Exiv2 in 2021 (after working on the project since 2008). I'm surprised nobody from the team replied. It's a boring Sunday afternoon in England and your questions have caught my attention. If you are still interested in this matter, please email me directly as I do not monitor the project. |
Beta Was this translation helpful? Give feedback.
Lots of good questions here. I'll try my best to answer using a modified samples/xmpdump.cpp to which I've added a few lines of code as follows: