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
Feature request: implement im.getxmp() to return all embedded XMP meta data as XML #5076
Comments
Hello @laynr @hugovk I'd like to take this issue, I'm already working on this. I already got the xmp tags out of the file, I'm just wondering which output structure would be best for the getxmp() to return I was thinking that it could be an object like the getexif(), but in this one I already got the tags name, so, instead of the tag number I could implement the actual tag name and its value |
Btw I also could just simply return its xml tree |
Great thanks @UrielMaD! It is probably best to keep it similar to getexif() if they return an object and adding tags name, instead of the tag number would be awesome... That said, there is definite value in just returning the XML tree. For one, returning the XML tree may be the most future proof as you wouldn't need to stay current on new tags names. I guess if you return an object, one of the objects functions can be to return the XML tree - perhaps that would be the best of both worlds! (but more work) For my personal project I just used the XML tree as the parsers for XML are well established. One thing I am noticing is that there can be multiple XMP sections in one file and not necessarily adjacent. Thank you for taking this on. I believe it will be very useful for many people! |
Thank you @Layn, then I'll send a PR implementing xml object, I can also return the whole xml tree as string. I get the tag names directly from what's in the xml tree so I will return only the tags that comes in that file, so if there's more xmp tags added in the future it will still return the new ones as they just come as tags attributes. |
@hugovk Changes were merged into my PR and all tests have passed |
Hi. Something to be aware of. Since the
in Pillow 8.3.0, we've added a new requirement - you will have to install |
Implement image.getxmp() similar to image.getexif(), that returns all embedded XMP meta data out of an image as XML
Something like:
FYI: This didn't work for me:
xmp_tags = self.info.get("XML:com.adobe.xmp")
I am sure this feature request has been asked before... but a search of 'XMP' in issues yielded nothing. Just asking for MVP, not write support, or tag comprehension.
XMP documentation:
Official: https://www.adobe.com/devnet/xmp.html
Helpful: https://exiftool.org/TagNames/XMP.html
Requesting output similar to the output of:
exiftool.exe -xmp:all -X image.jpg
The text was updated successfully, but these errors were encountered: