Page MenuHomePhabricator

Don't use filename as alt attribute
Closed, DeclinedPublic

Description

Example wiki text:

[[File:Example.jpg|50px]]
[[File:Example.jpg|thumb]]
[[File:Example.jpg|50px|link=foo]]

This currently sets the alt attribute for all images to "Example.jpg", which shouldn't be done (http://www.w3.org/TR/2012/NOTE-WCAG20-TECHS-20120103/F30).

IMHO an empty alt attribute for the first two, and an alt="foo" for the last makes much more sense.


Version: 1.22.0
Severity: minor

Details

Reference
bz52267

Related Objects

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:03 AM
bzimport set Reference to bz52267.
bzimport added a subscriber: Unknown Object (MLST).

We have had many discussion about this in the past. I think in the past we concluded that it was better to set the alt this way (also because we actually have quite descriptive filenames quite often). I also remember some discourse on that though.

It definitely should NOT be empty alt. Part of the reasoning was if I remember correctly, that alt='' means an active acknowledgment of the fact that it is an image does not even require an alt text. Which is not the case for these 'auto generated' alts. At most we should then simply not define an alt at all.

Anyway, there should be a couple of closed tickets discussing this very topic, and a slew of en.wp discussion somewhere on this.

See bug 24586 comment 3, etc.

Tgr subscribed.

Closing per comments above. Hopefully with centralized structured data now available not having real alt text will become less of a problem.

See bug 24586 comment 3, etc.

(That would be T26586#286696.)