Help:Lint エラー/bogus-image-options

From mediawiki.org
This page is a translated version of the page Help:Lint errors/bogus-image-options and the translation is 50% complete.
Other languages:

The bogus-image-options error is when an image is detected to use a non-existent option. For example in the code [[File:Example.jpg|foo|bar|baz]], "foo" and "bar" are bogus options, and "baz" shows up as the caption.

Help:画像 has details on the supported image options, including a few notes about the quirky behavior of some of the parameters.

Known bugs in the Linter bogus file options detection include, but are not limited to:

  • Parent task: タスク T274382 - Make File syntax processing match the specification and documentation
  • タスク T216003 - Linter fails to detect a quotation mark after the "upright" number.
  • タスク T264464 - Conflicting border/thumb/frame options are not detected as Linter errors
  • タスク T216566 - Capitalized versions of valid File options are usually ignored, but are not flagged as Linter bogus file options
  • タスク T179605 - LintError bogus-image-options triggers on "Thumbtime"
  • タスク T276675 - Image caption ending in "px" is incorrectly detected as a Linter error (To work around a false positive error when "px" is at the end of a caption, add {{sp}} after "px". It will add a space, which does not change the displayed caption but which makes the error go away.)

In addition some other supported file options such as video and multi-page formats (e.g. pdf) are also checked.

よくあるエラーの一部を示します:

  • オプションの繰り返し、例: [[File:Example.jpg|thumb|right|thumb]][[File:Example.jpg|thumb|right]]
  • オプションの競合、例: [[File:Example.jpg|thumb|right|150px|left]][[File:Example.jpg|thumb|right|150px]]
  • Conflicting border/frame/thumb options (not reported as a Linter error; see phab link above), e.g. [[File:Example.jpg|border|thumb|right|150px]][[File:Example.jpg|thumb|right|150px]] (always remove the "border" option)
  • A manual line break in |alt= or in the caption. (Remove the line break to fix the error.)
  • 空欄のオプション、例: [[File:Example.jpg|thumb||right]][[File:Example.jpg|thumb|right]]
  • 2 個のキャプション、例: [[File:Example.jpg|thumb|right|Intended alt text|キャプション テキスト]][[File:Example.jpg|thumb|right|alt=Intended alt text|キャプション テキスト]]
  • A plain number instead of a px value, e.g.

[[File:Example.jpg|thumb|right|225|キャプション テキスト]][[File:Example.jpg|thumb|right|225px|キャプション テキスト]]

  • オプションの誤字脱字、例: [[File:Example.jpg|thumb|fight|キャプション テキスト]][[File:Example.jpg|thumb|right|キャプション テキスト]]
  • Use of left, right or ###px (any unlabeled pixel size) within ‎<gallery>...‎</gallery> tags.

To fix, remove left or right. Set pixel dimensions using instructions at Help:画像 .

ツール

The following tools can help fix bogus image options:

Bogus image options may be reported by WPCleaner as part of CheckWiki error #534.