View Single Post
Old 05-14-2024, 05:08 PM   #14
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Doitsu View Post
Apparently, AltTextAccessibility is an Exiv2 metadata entry. The closest EXIF equivalent is ImageDescription, which Pillow supports. Theoretically, Pillow is also supposed to support XML metadata via getxmp(), but I couldn't get the sample code to work.

The sample image referred to by BeckyEbook and DNSB contains the following metadata as plain text:
Code:
 <Iptc4xmpCore:AltTextAccessibility>
   <rdf:Alt>
    <rdf:li xml:lang='x-default'>This is the Alt Text description to support accessibility in 2022.1</rdf:li>
    <rdf:li xml:lang='en'>This is the Alt Text description to support accessibility in 2022.1</rdf:li>
   </rdf:Alt>
  </Iptc4xmpCore:AltTextAccessibility>
The sample image provided by the OP only contains an <rdf:li xml:lang="x-default"> entry.

Some StackOverflow users recommended searching for XMP metdata as text and parsing it with bs4.
That is an idea. I will read up on that.
KevinH is offline   Reply With Quote