You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While implementing heic support to picframe, I had to find out that IPTC is not supported for heic images.
But IPTCcore is part of XMP. So I use XMP tags. If they are available they will override IPTC tags (e.g. for jpg images)
I used the following mapping:
IPTC Keywords -> XMP subject
IPTC Object Name -> XMP Headline (XMP Title is a valid tag. But Headline seems to be used more widely???)
IPTC Caption/Abstract -> XMP description
The Pillow function xmp = image.getxmp() returns a dictionary of XMP Tags. Unfortunately the structure seems not to be fixed, so I implemented a recursive search for the tags. To make it more worse, I found images in the net, where sub dictionary elements are splitted in list elements.
I ended in this not so nice code. Do one of you have an idea fore a nicer and more robust code, to extract the tags? I tried to avoid using other libs (e. g. extracting the original xml structure and use something like xml.searchelement).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While implementing heic support to picframe, I had to find out that IPTC is not supported for heic images.
But IPTCcore is part of XMP. So I use XMP tags. If they are available they will override IPTC tags (e.g. for jpg images)
I used the following mapping:
The Pillow function
xmp = image.getxmp()
returns a dictionary of XMP Tags. Unfortunately the structure seems not to be fixed, so I implemented a recursive search for the tags. To make it more worse, I found images in the net, where sub dictionary elements are splitted in list elements.I ended in this not so nice code. Do one of you have an idea fore a nicer and more robust code, to extract the tags? I tried to avoid using other libs (e. g. extracting the original xml structure and use something like xml.searchelement).
Beta Was this translation helpful? Give feedback.
All reactions