Make WordPress Core

Opened 20 years ago

Closed 19 years ago

Last modified 3 years ago

#3100 closed defect (bug) (fixed)

Images shouldn't have alt attributes of filenames

Reported by: matt Owned by: rob1n
Priority: normal Milestone: 2.3
Component: Administration Version: 2.0.4
Severity: normal Keywords: has-patch commit dev-feedback
Cc: Focuses:

Description

When you upload a photo, and don't give it a title, it gets a title of the filename.

Then when you insert the picture into the editor, if gives the picture an alt attribute withthe file name.

Under no circumstances should default behavior give alt attributes of filenames, so we should avoid this.

Attachments (1)

3100_upload-alt.patch (458 bytes ) - added by cpoteet 19 years ago.
Fix.

Download all attachments as: .zip

Change History (21)

#1 @Nazgul
20 years ago

  • Keywords needs-patch added
  • Milestone2.0.4
  • Version2.1

Any suggestions on what should be in the alt attribute? Or do we leave it empty?

#2 @Nazgul
20 years ago

  • Milestone 2.0.42.1
  • Version 2.12.0.4

Damn. That should be the other way around. :)

#3 @matt
20 years ago

  • Milestone 2.12.2

#4 follow-up: @cpoteet
20 years ago

  • Owner changed from skeltoac to cpoteet
  • Status newassigned

#5 in reply to: ↑ 4 @cpoteet
20 years ago

What do you think should be replaced instead of the filename? alt="" isn't a much better option.

#6 @matt
20 years ago

Blank is better than something that's not actually alt text:

http://diveintoaccessibility.org/day_21_ignoring_spacer_images.html

#7 @markjaquith
20 years ago

Amazon's Mechanical Turk to the rescue! :-)

But seriously... if we don't have data in the form of a manually specified title, the best thing we can do is use alt=""

#8 @foolswisdom
20 years ago

Relates to #3744

@cpoteet
19 years ago

Fix.

#9 @cpoteet
19 years ago

  • Resolutionfixed
  • Status assignedclosed

It's not pretty, but it's better than the alt tags with no semantic value.

#10 @rob1n
19 years ago

  • Keywords has-patch added; needs-patch removed
  • Resolution fixed
  • Status closedreopened

cpoteet: Welcome to the WordPress Trac, but just FYI we don't close the ticket as "fixed" until it's committed into the trunk.

#11 @cpoteet
19 years ago

Is this going to be added to the trunk?

#12 @foolswisdom
19 years ago

  • Milestone 2.22.3

#13 @cpoteet
19 years ago

  • Milestone 2.32.2
  • Priority normalhigh
  • Severity normalmajor

#14 @rob1n
19 years ago

  • Milestone 2.22.3
  • Priority highnormal
  • Severity majornormal

It's hardly essential, so bumping to 2.3. Only essential bugfixes are going in 2.2 as of this point.

#15 @RuddO
19 years ago

I actually think the file name is a good default, provided it's stripped from the extension. Now, what would be AWESOME is if clicking on the attachment name made the name into a text box, that onBlur renamed the file using AJAX or something like it. Thus, the usability problem of taking the file name as the attachment title (and corresponding alt attribute) becomes a minor annoyance.

#16 @Nazgul
19 years ago

The filename, even without the extension, should never be used for the alt tag.

A filename is bound by the limitations of the filesystem, therefore people often replace spaces with underscores or use CamelCase. I don't know if you've ever listened to a screenreader trying to pronounce that. It's just plain ugly.

I'd rather see empty alt attributes than filenames (with or without extension). Although making a meaningfull alt attribute mandatory would get a +100 from me.

(Anecdote: A blind friend of mine showed me a site which was read to us by his screenreader. During the reading it said "spacer.gif" over 50 times before even reaching the actual content on that page. Every time you mention the word spacer.gif in his vicinity nowadays he starts to twitch ;) )

#17 @cpoteet
19 years ago

  • Keywords commit dev-feedback added

#18 @rob1n
19 years ago

  • Owner changed from cpoteet to rob1n
  • Status reopenednew

#19 @foolswisdom
19 years ago

  • Summary Awful alt attributesImages shouldn't have alt attributes of filenames

#20 @rob1n
19 years ago

  • Resolutionfixed
  • Status newclosed

(In [5653]) Better use empty alt attribute than the filename. Props cpoteet. fixes #3100

Note: See TracTickets for help on using tickets.