Add alt= parameter support for files in a <gallery>
Closed, ResolvedPublic

Description

Author: bury.rodan

Description:
Images have an alt= attribute, so one can describe the image and allow handicaped people to get audio information.

[[Image:Pic.jpg|alt=This is displayed if the image isn't shown! Furthermore, IE may show this as tooltip.]]

But it is impossibe with <gallery></gallery>.

I hope we could have somethig similar to the following:

<gallery caption="Sample gallery" widths="100px" heights="100px" perrow="6">
Image:Drenthe-Position.png|[[w:Drenthe|Drenthe]], the least crowded province.|alt=This is displayed if the image isn't shown! Furthermore, IE may show this as tooltip.
Image:Flevoland-Position.png|alt=This is displayed if the image isn't shown! Furthermore, IE may show this as tooltip.
</gallery>

I hope someone can fix this bug, I believe it is quite important for the accessibility.


Version: 1.18.x
Severity: enhancement

bzimport set Reference to bz18682.
bzimport created this task.Via LegacyMay 4 2009, 8:49 PM
brion added a comment.Via ConduitMay 4 2009, 8:53 PM

Given that there's a caption and a link to a detail page, can you provide an example of what might be used for alt text in a gallery?

bzimport added a comment.Via ConduitMay 4 2009, 10:52 PM

bury.rodan wrote:

A french user tried to use alt text here : http://fr.wikipedia.org/w/index.php?title=Cantine&oldid=40547077#Importance_sociale_de_la_cantine

Is this the example you are asking ? I have translated it quickly here http://fr.wikipedia.org/wiki/Utilisateur:Dodoïste/bac_à_sable_perso

brion added a comment.Via ConduitMay 7 2009, 6:25 PM

Those seem like fairly decent alt texts, pretty rare! :D Not a bad use.

We should probably consider better ways to deal with alt text though -- perhaps these should be centralized to the image generally? If the file is used in multiple places, a description of its ''content'' will probably tend to be the same in most cases.

But being able to override it in a gallery as well as an indidivual usage makes sense. Parsing of additional parameters would need to be added; currently I believe gallery just splits the lines into name and caption pieces.

Xeno added a comment.Via ConduitJul 24 2009, 1:00 AM

That's a great idea Brion, one that I actually just proposed at https://bugzilla.wikimedia.org/show_bug.cgi?id=19906

bzimport added a comment.Via ConduitAug 27 2009, 9:59 AM

bury.rodan wrote:

Please reconsider, Brion. Alt text depends heavily on context, as explained in our guidelines for alt text. http://en.wikipedia.org/wiki/Wikipedia:Alternative_text_for_images#Context

gpaumier added a comment.Via ConduitNov 18 2009, 8:01 PM

A centralized description could be stored nonetheless and used as default alt text. The override feature would guarantee that the alt text can be modified to better fit with the context in each case.

gpaumier added a comment.Via ConduitDec 31 2009, 11:18 PM

(In reply to comment #3)

We should probably consider better ways to deal with alt text though -- perhaps
these should be centralized to the image generally? If the file is used in
multiple places, a description of its ''content'' will probably tend to be the
same in most cases.

Note that this was requested as bug 19906.

brion added a comment.Via ConduitApr 14 2010, 3:42 PM

Re-waking this bug as there's been some interest lately.

Here's a shorter example usage, using the same style as the page linked above:

<gallery>
File:Wiki.png|Wikipedia's logo|alt=A gray globe made of puzzle pieces, labeled with letters from many different writing systems.
</gallery>

The usage of the |s pretty much matches existing [[File]] tags; should be pretty easy to adapt, perhaps using the same functions as used there if it's not too deep in the parser.

bzimport added a comment.Via ConduitNov 20 2010, 7:10 AM

info wrote:

Hello. Sorry for my bad English. Other examples of articles in which I took around the "bug" in describing the images into notes: http://fr.wikipedia.org/wiki/Boite_de_conserve#Notes_et_r.C3.A9f.C3.A9rences, http://fr.wikipedia.org/wiki/Cuisine_de_la_pomme_de_terre, http://fr.wikipedia.org/wiki/Conservation_de_la_viande
These descriptions have encountered criticism from French users when I submit the articles to the quality label because they add to the page and are unpleasant to people without disabilities. Technically, I cannot help, but as a writer, I very much hope that you can find a solution. Sincerely, Égoïté

bzimport added a comment.Via ConduitFeb 18 2011, 9:18 AM

maria.schiewe wrote:

I know that moaning won’t get this bug fixed, but I am desperate. I was quite happy when galleries were finally free of layout tables (#3276). However, gallery is as useless as before without the possibility to add alternative text to the images. The more images you have in an article, the more missing alt texts are annoying. And usually articles containing a lot of images (e.g. about paintings) are using galleries.

Is this bug too hard to fix? As an outsider it seems fairly easy to me adding the |alt=. Are there other reasons preventing this bug to get fixed? Or is it just not important enough? It do is for all the screen reader users!

bzimport added a comment.Via ConduitApr 22 2011, 2:04 PM

jp.posma wrote:

Fix

This fixes the problem while not breaking existing captions with |s in it. Passes existing parser tests, and adds a new line to a parser test for checking this behaviour.

Apply patch to trunk/phase3.

attachment 18682 ignored as obsolete

DieBuche added a comment.Via ConduitApr 22 2011, 2:41 PM

(In reply to comment #11)

Created attachment 8444 [details]
Fix

This fixes the problem while not breaking existing captions with |s in it.
Passes existing parser tests, and adds a new line to a parser test for checking
this behaviour.

Apply patch to trunk/phase3.

Cool. I'll have a look at it tonight & will commit it if don't see any problems.

attachment 18682 ignored as obsolete

Bawolff added a comment.Via ConduitApr 23 2011, 2:30 AM

As an aside, it'd be cool if we could support all the normal thumbnail params (or the one's that make sense anyways). As it stands, you can't do thinks like specify show page 5 of a pdf in a gallery, or use lossless/lossy (whichever is not the default) thumbnail for a tiff file

DieBuche added a comment.Via ConduitApr 23 2011, 7:29 AM

(In reply to comment #13)

As an aside, it'd be cool if we could support all the normal thumbnail params
(or the one's that make sense anyways). As it stands, you can't do thinks like
specify show page 5 of a pdf in a gallery, or use lossless/lossy (whichever is
not the default) thumbnail for a tiff file

The only sane way imo, would be to split the param parsing stuff from makeImage() into a separate function & use it for the gallery stuff as well. Afterwords just ignore those params that don't apply.

Patched in r86749, Bawolff do want to open a new bug or edit this ones summary?

DieBuche added a comment.Via ConduitApr 23 2011, 9:57 AM

and reverted in r86752

bzimport added a comment.Via ConduitApr 23 2011, 2:54 PM

jp.posma wrote:

Second attempt

This patch again only adds the alt= tag, no other tags that normal images do have, as I'm not yet familiar enough with the parser to confidently do that. ;)

Also includes suggestions by diebuche (some cleanup) and Duplicatebug (correct magic word, wikitext inside caption, extra parser tests), and fixes a notice in MagicWord.php.

Patch to trunk/phase3.

Attached: 18682b

Bawolff added a comment.Via ConduitApr 23 2011, 3:55 PM

Patched in r86749, Bawolff do want to open a new bug or edit this ones summary?

It really should be a separate bug I suppose. In any case worrying about that shouldn't stop you from fixing this, just if there was an easy way to do all of them, that'd be really awesome. There's also bug 8480.

bzimport added a comment.Via ConduitApr 26 2011, 6:52 PM

jp.posma wrote:

Committed by DieBuche in r86859.

Peachey88 added a comment.Via ConduitMay 6 2011, 6:50 AM

*Bulk BZ change: -bugsmash from closed bugs. (7 Bugs)*

Gilles added a project: Multimedia.Via WebNov 24 2014, 3:19 PM
Gilles moved this task to Closed on the Multimedia workboard.Via WebDec 2 2014, 8:56 AM

Add Comment