imageaccessibilityaltwcagxmp

Is there a reason we don't embed image alt-tags in XMP data?


I've been searching high and low for this, so maybe I'm missing something.

Why isn't there a standard for embedding alt information into an image—for the web, for screen readers, for PDFs, etc.?

I realize that the alt tag in HTML is used for if an image doesn't show up, so I don't think browsers should be left with the burden of interpreting, say, XMP data into alt text. But we could include the functionality in pre-compiler (e.g., Jekyll could read XMP data when rendering HTML pages) and server-side scripts (e.g., PHP could render).

Is this something that's been discussed before? Am I being naive? I'm just trying to think about how to reduce the steps to developing a more accessible screen-based experience.


Solution

  • I was just looking for context on this, and it looks like there is an XMP IPTC tag for just this: AltTextAccessibility see exiftool context here.

    So you could run the following:

    exiftool -xmp:AltTextAccessibility-en="A rabbit" -xmp:AltTextAccessibility-fr="Un lapin" some-image.jpg
    

    And store multiple locale's worth of alt text inside an image (in its XMP container), then you could use your site's preprocessor to extract the relevant one like this:

    exiftool -s3 -xmp:AltTextAccessibility-fr some-image.jpg
    Un lapin