Difference between revisions of "Help:Images"
Jump to navigation
Jump to search
(Created page with "== Rendering a single image == === Syntax === The full syntax for displaying an image is: <nowiki>[[</nowiki>File:''filename.extension''|''options''|''caption'']] where...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 11: | Line 11: | ||
* ''Format'' option: one of '''border''' and/or '''frameless''', '''frame''', '''thumb''' (or '''thumbnail'''); | * ''Format'' option: one of '''border''' and/or '''frameless''', '''frame''', '''thumb''' (or '''thumbnail'''); | ||
*: Controls how the rendered image is formatted and embedded in the rest of the page. | *: Controls how the rendered image is formatted and embedded in the rest of the page. | ||
− | * ''Resizing | + | * ''Resizing'' option: one of |
** ''{width}'''''px''' — Resizes the image to fit within the given maximum width in pixels, without restricting its height; | ** ''{width}'''''px''' — Resizes the image to fit within the given maximum width in pixels, without restricting its height; | ||
** '''x'''''{height}'''''px''' — Resizes the image to fit within the given maximum height in pixels, without restricting its width; | ** '''x'''''{height}'''''px''' — Resizes the image to fit within the given maximum height in pixels, without restricting its width; | ||
Line 41: | Line 41: | ||
==See Also== | ==See Also== | ||
* https://www.mediawiki.org/wiki/Help:Images for expanded information about images | * https://www.mediawiki.org/wiki/Help:Images for expanded information about images | ||
+ | * https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax |
Latest revision as of 13:13, 10 November 2015
Rendering a single image
Syntax
The full syntax for displaying an image is:
[[File:filename.extension|options|caption]]
where options can be zero or more of the following, separated by pipes (|):
- Format option: one of border and/or frameless, frame, thumb (or thumbnail);
- Controls how the rendered image is formatted and embedded in the rest of the page.
- Resizing option: one of
- {width}px — Resizes the image to fit within the given maximum width in pixels, without restricting its height;
- x{height}px — Resizes the image to fit within the given maximum height in pixels, without restricting its width;
- {width}x{height}px — Resizes the image to fit within the given width and height in pixels;
- upright — Resizes an image to fit within reasonable dimensions, according to user preferences (suitable for images whose height is larger than width).
- Note that the image will always retain its aspect ratio, and can only be reduced (not increased) in size unless it's in a scalable media type (bitmap images cannot be scaled up).
- The default maximum size depends on the format and the internal image dimensions (according to its media type).
- Horizontal alignment option: one of left, right, center, none;
- Controls the horizontal alignment (and inline/block or floating styles) of the image within a text (no default value).
- Vertical alignment option: one of baseline, sub, super, top, text-top, middle, bottom, text-bottom;
- Controls the vertical alignment of a non-floating inline image with the text before or after the image, and in the same block (the default vertical alignment is middle).
- Link option: one of
- link={target} — Allows to change the target (to an arbitrary page title, or URL) of the generated link, activable on the rendered image surface; e.g.
[[File:Example.jpg|20px|link=http://www.wikipedia.org]]
renders as(external link), or
[[File:Example.jpg|20px|link=MediaWiki]]
renders as(internal link).
- link= (with an empty value) — Displays an image without any activable link; e.g.
[[File:Example.jpg|20px|link=]]
renders as.
- ! If you set
|link=|
(empty), then notitle
will be rendered.
- ! If you set
- link={target} — Allows to change the target (to an arbitrary page title, or URL) of the generated link, activable on the rendered image surface; e.g.
If a parameter does not match any of the other possibilities, it is assumed to be the caption text.
Caption text shows below the image in thumb and frame formats, or as tooltip text in any other format.
Caption text displayed in the thumb and frame formats may contain wiki links and other formatting.
MediaWiki extensions can add additional options.
If 'alt' is not specified and a caption is provided, the alternative text will be created automatically from the caption, stripped of formatting.
See Also
- https://www.mediawiki.org/wiki/Help:Images for expanded information about images
- https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax