archive_me1Add my vote for this tag create new tag
, view all tags

Use image description as alt text

For attached images, ATTACHEDIMAGEFORMAT uses by default the file name as alt text. Wouldn't it be more logical to have its description as the default alt text?

Page contents:


The image file name does not reveal that much. I've looked for advice at http://www.w3.org/TR/html401/struct/objects.html#h-13.8 and http://www.webaim.org/tutorials/alt:

Images and graphical buttons: If an image is only used for decoration, add a descriptive alt tag.

That's about the amount of useful information on that page... Thinking about this more, it would be more useful if the alt text shows it is an image, like: alt="image: screenshot of my homepage". Looking a bit further I found this document at http://aad.uoregon.edu/culturework/tj/access.html that confirms that the alt description should not only have a short text description:

One difficulty with such conciseness is that the text when read by a speech program working from LYNX, the text may not differentiate itself adequately from surrounding text as being a description of a graphic. So it may be useful to add a word such as image, with a colon, to preface the description: <img src = "1tj.gif" alt = "image: wall painting of word "STET" and self-portrait of artist">

Joe Clark in "Building accessibile websites" tells me not to use "image:" in alt tags. The screen reader will provide for this. In an alt tag, just give the description of the image, no meta data.


So taking this to the preference settings, the default setting in TWiki.TWikiPreferences could be:

   * Set ATTACHEDIMAGEFORMAT = \t* $comment: <br /><img src="%ATTACHURLPATH%/$name" alt="$comment" $size />

-- ArthurClemens - 13 Nov 2003


This is a sensible enhancement request. One detail: The $comment might contain illegal chars for the alt tag, like double quote. Possibly introduce a new $altcomment variable?

-- PeterThoeny - 14 Sep 2003

It's already possible to use $comment - just set it in the preferences. To prevent breaking the HTML, either:

  1. Don't accept quote characters in the attachment description field (throw them away)
  2. Convert quote to &quot;
  3. Convert quote to single quote

There is a bug with using quotes and ampersands in the comment field. See BugWithQuotesInAttachmentComment.

-- ArthurClemens - 15 Sep 2003


The proposal can be implemented straight away - just change the TWikiPreferences. To fix an existing bug with illegal characters, see BugWithQuotesInAttachmentComment.

-- ArthurClemens - 13 Oct 2003

I made the change in TWikiPreferences on twiki.org.

-- ArthurClemens - 22 Feb 2004

See also: ConfigurableAttachLinkFormat
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2004-02-22 - ArthurClemens
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.