Skip to content
easeweb
Search topics

Image uploads that never ask for alt text

A marketplace's listing form uploads each photo and publishes it with its file name as the alt text, without ever asking the seller what the photo shows.

EN 301 549
Clause 11.8.2Clause 11.8.3Clause 11.8.4Clause 11.8.5
Section 508
504
Broken img.alt = file.name;
The accessibility problem illustrated: No vision:What does the mug look like?
01

The problem

Shoppers who use a screen reader hear a file name instead of what a product looks like, because the form that published the photo never asked the seller to describe it.

02

Try it

List the enamel mug with its photo, then hear the published photo as a screen reader would.

  1. Press Add a photo. The demo picks IMG_2041.jpg for you, as a phone’s photo picker would.
  2. Do what the form asks, if it asks anything, and press Publish listing.
  3. The panel under the form says what a screen reader reads for the published photo.

Broken Can you fix this?

BrokenA photo published with its file name

New listing

Photos

Screen reader says:

(Publish the listing, then move to its photo)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Ask the author what each image shows, before it is published, wherever the image comes from, and let them mark one as decorative.

  1. 1Ask for a description for every image, wherever it comes from, before it is published.
  2. 2Never fill in the alt text for the author with a file name, a title or the word image.
  3. 3Let the author mark an image as decorative, and publish it with an empty alt.
Before A photo published with its file name
<form action="/listings" method="post">  <label for="title">Title</label>  <input id="title" name="title">  <label for="photo">Add a photo</label>  <input id="photo" type="file" accept="image/*">  <div id="photos"></div>  <button type="submit">Publish listing</button></form>
After

Ask for a description when the photo is added

<form action="/listings" method="post">  <label for="title">Title</label>  <input id="title" name="title">  <label for="photo">Add a photo</label>  <input id="photo" type="file" accept="image/*">  <div id="photos"></div>  <button type="submit">Publish listing</button></form> <dialog id="describe" aria-labelledby="describe-title">  <form method="dialog">    <h2 id="describe-title">Describe this photo</h2>    <img id="preview" alt="">    <label for="photo-alt">What does the photo show?</label>    <p id="photo-alt-hint">Shoppers who can't see the photo hear this instead. Say what a buyer      would want to know: colour, size, what it's made of.</p>    <textarea id="photo-alt" aria-describedby="photo-alt-hint"></textarea>    <p id="photo-alt-error" hidden>Describe the photo, or tick the box below.</p>    <label><input type="checkbox" id="decorative"> It only decorates the listing: nothing to describe</label>    <button value="add">Add photo</button>    <button value="cancel">Cancel</button>  </form></dialog>

Fixing this with an AI coding assistant? Get this guide as Markdown, or get every guide in your coding agent.

04

Verify the fix

4 checks, no mouse.

Test with: Keyboard, Screen reader

0 of 4 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after any change to how photos are added.

Limits

This guide covers how an authoring tool asks for image descriptions. The same clauses ask more of a tool than this. A text editor must let authors make real headings and lists rather than large bold text, as headings chosen by size, not by structure shows from the page's side, and keep them when text is pasted in or converted (EN 301 549 11.8.3, Section 508 504.2.1). Where the tool checks content, it must suggest a repair (11.8.4), and where it offers templates, at least one must be accessible and said to be (11.8.5). Whether the tool's own screens work for authors with disabilities is a separate question, which WCAG and ATAG 2.0 Part A cover. Test with your sellers, and with the shoppers who will read their listings.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work