New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method to write LocationShown and LocationCreated in IPTC Extension schema #1254
Comments
I don't know anything about this. However, I'm writing a book Image Metadata and Exiv2 Architecture. Here's the current draft: https://clanmills.com/exiv2/book I intend to start work for the book on IPTC in next week or two. I've been working on Exiv2 for 12 years and most of my effort has been focused on bugs, build and test. The IPTC code is very stable, so I don't know much about it! The XMP code is the Adobe XMPsdk 4.4.0 and you can build/link more recent Adobe offerings. I will investigate. |
There have been a few discussions about this in years gone by. For example: https://dev.exiv2.org/boards/3/topics/2016?r=2025#message-2025 As you can see, Scott Renton concluded that "we're heading in the right direction now", although to be honest, I didn't really know what we were discussing! I recommend that you use the search on the "old" bug tracker and you might find what you want. |
I'm pretty sure that your answer is in the discussion with the person at the University of Edinburgh. If you agree, could you close this issue please. If you need further assistance, I will try to help although I really don't know much about XMP and/or IPTC. |
Thanks for your help Robin. It doesn't look like we can do exactly what I was looking for in Exiv2 but no worries, I think it's fair to say that this seems like more of a job for Adobe's XMP Toolkit. I'll close the issue. |
I'm glad to not have this sitting "on my plate". Thanks for closing this. If you can do this with XMPsdk, it's probably possible to do it from Exiv2 which mostly puts an Exiv2 veneer over XMPsdk. I don't want to increase the scope of the book, however I will think about adding a chapter to discuss XMP as I haven't found Adobe's documentation to be very illuminating. The primary focus of the book is to deal with file formats and to explain how the metadata is stored in the image and how it is parsed. |
I've done the following:
So it created the bag and added something. We want to edit that now to be what you discussed above.
|
Progress:
|
Thank you for the help so far! I'm trying from my end too but obviously can't quite match your expertise. |
I assure you that I have no expertise with this. I'm floundering in the dark. I think I know everything about image formats and how Exif and ICC is stored and manipulated. The XMPsdk is however a total mystery to me. I know even less about IPTC - although at least IPTC is on my TODO list for the book. I've had another idea. If we express this in IPTC, the convertor magic will probably move it into XMP. I'm looking at the test and sample code for IPTC. |
I know how to solve this although I don't know the solution: The command
When I try your proposed XML/xmp:
That '201' is coming directly from XMPsdk. He's saying "I hate your XML/xmp". So now we have better focus. A couple ways to progress: 1 Use an Adobe Application OR The XmpBag with the Time for lunch. I'm fairly confident that we can fix this. The road to the solution is to use an Adobe Application to set up a good file and then we can figure out how to create a similar file with Exiv2. Do you have PhotoShop or LightRoom? |
I've taken my own medicine. I've loaded a photo in ACDC PhotoStudio 5 for Mac and edited the IPTCExt metadata. I set the City to "Camberley" and he stored as at XML attribute: Your turn. We need a solid definition of what we want/need and then we'll figure out how to get there.
|
I do indeed have Photoshop, I've set the fields through there and the XMP dump gives:
The initial XML I provided was actually taken from the Raw Data viewer within Photoshop. I checked again, and it does give that same li structure, so there just seems to be some discrepancy in how Photoshop interprets/displays the XML |
We're almost there. It's a Bag with a single element and the City CountryName items are attributes. We only need to know the syntax for an attribute and we'll be done. I don't see it in the exiv2 man page. I'm going to have a break for lunch. Speak later. |
Yes, that's right. An XmpBag is like a JavaScript object (key/value pairs). Right. That make sense (sort of). |
Enjoy your lunch! I've been using the C++ library rather than the command line executable, and I can see that example 5 of https://www.exiv2.org/examples.html has what we need, so now it's just a case of finding the command line equivalent |
So it seems like this does the trick:
|
Thank you so much for your help! I'm looking forward to reading the book :) |
Wonderful. I think we're done on this. Teamwork is really effective. I don't know why nobody uses it in the office and never in the open-source community. Why use teamwork when you can bully or throw a tantrum instead? I leave you to close this issue if you're happy. |
I am more than happy, thanks again |
The book is my escape plan. I'll be 70 in January and I want to leave Exiv2 and focus on my musical interests. If I document everything I know about metadata, maybe somebody will maintain Exiv2 or write a new library. I've been a good and diligent servant to the world of open-source. https://clanmills.com/exiv2/book |
Per https://exiv2.org/tags-xmp-iptcExt.html and the associated IPTC Extension specifications, the value type of LocationShown and LocationCreated is a LocationDetails bag. The resulting Xmp section would look something like:
I haven't been able to find anything in the docs that would allow keys to be nested within a Bag like this.
If there is a way, I would be grateful if somebody would be able to share it with me.
The text was updated successfully, but these errors were encountered: