Last modified: 2011-05-06 06:50:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T20682, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18682 - Add alt= parameter support for files in a <gallery>
Add alt= parameter support for files in a <gallery>
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.18.x
All All
: Highest enhancement with 10 votes (vote)
: ---
Assigned To: Jan Paul Posma
: accessibility, patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-04 20:49 UTC by Rodan BURY
Modified: 2011-05-06 06:50 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Fix (4.18 KB, patch)
2011-04-22 14:04 UTC, Jan Paul Posma
Details
Second attempt (9.49 KB, patch)
2011-04-23 14:54 UTC, Jan Paul Posma
Details

Description Rodan BURY 2009-05-04 20:49:34 UTC
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.
Comment 1 Brion Vibber 2009-05-04 20:53:12 UTC
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?
Comment 2 Rodan BURY 2009-05-04 22:52:19 UTC
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
Comment 3 Brion Vibber 2009-05-07 18:25:45 UTC
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.
Comment 4 xenocidic 2009-07-24 01:00:34 UTC
That's a great idea Brion, one that I actually just proposed at https://bugzilla.wikimedia.org/show_bug.cgi?id=19906
Comment 5 Rodan BURY 2009-08-27 09:59:04 UTC
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 
Comment 6 Guillaume Paumier 2009-11-18 20:01:50 UTC
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.
Comment 7 Guillaume Paumier 2009-12-31 23:18:14 UTC
(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.
Comment 8 Brion Vibber 2010-04-14 15:42:18 UTC
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.
Comment 9 Égoïté 2010-11-20 07:10:17 UTC
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é
Comment 10 Maria Schiewe 2011-02-18 09:18:00 UTC
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!
Comment 11 Jan Paul Posma 2011-04-22 14:04:23 UTC
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.
Comment 12 DieBuche 2011-04-22 14:41:20 UTC
(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.
Comment 13 Bawolff (Brian Wolff) 2011-04-23 02:30:45 UTC
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
Comment 14 DieBuche 2011-04-23 07:29:19 UTC
(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?
Comment 15 DieBuche 2011-04-23 09:57:11 UTC
and reverted in r86752
Comment 16 Jan Paul Posma 2011-04-23 14:54:51 UTC
Created attachment 8451 [details]
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.
Comment 17 Bawolff (Brian Wolff) 2011-04-23 15:55:17 UTC
> 
> 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.
Comment 18 Jan Paul Posma 2011-04-26 18:52:29 UTC
Committed by DieBuche in r86859.
Comment 19 p858snake 2011-05-06 06:50:01 UTC
*Bulk BZ change: -bugsmash from closed bugs. (7 Bugs)*

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links