Our new season is now open: Spring 1677 !

Help:Extended image syntax

From AoI Wiki
Jump to: navigation, search

The majority of this text has been taken from the Wikipedia Page on the same subject.

In brief, the syntax for displaying an image is:

[[Image:{name}|{type}|{location}|{size}|{upright}|{border}|{caption}]]

Only [[Image:{name}]] is required. Most images should use [[Image:{name}|thumb|Example image caption]] (and should not specify a size). The other details are optional and can be placed in any order.


Type 
'thumb' / 'thumbnail' or 'frame'. Causes image to be displayed with specific formatting (see below).
Location 
'right', 'left', 'center' or 'none'. Determines placement of the image on the page. Defaults to 'right'.
Size 
{width}px or {width}x{height}px, scales the image to be no greater than the given width and height, keeping its aspect ratio.
Upright 
for use only on images that are taller than they are wide. This scales the image differently, considering both width and height instead of only width.
Border 
adds a border around the image
Caption 
Any element which cannot be identified as one of the above is assumed to be caption text.


Contents

Detailed syntax

Type

  • "thumbnail" or "thumb": Image is scaled down to a standard, user specified width, by default 180 pixels, and a box is added around the image. If a caption is written, it is shown below the image. Image defaults to placement on the 'right' unless overridden with the 'Location' attribute (see above).
  • "frame": Original image size is preserved, and a box is added around the image. If a caption is written, it is shown below the image.
  • (nothing specified): Original image size is preserved, no border is added around the image. If a caption is written, it is not shown.
  • "border": Same as if nothing is specified, but a border is added around the image.

Location

  • "right": Image including its box is placed on the right side of the page. The article text that follows the image flows around the image.
  • "left": Image including its box is placed on the left side of the page. The article text that follows the image flows around the image.
  • "center": Image including its box is placed in the center of the page. The article text that follows the image is placed below the image.
  • "none": Image including its box is placed on the left side of the page. The article text that follows the image is placed below the image.

Size

  • "100px": Scales the image down to make it 100 pixels wide. Replace any number for 100. If you specify "thumbnail" and a value here, this value will take precedence. If the image is already smaller than your specified value, the image stays at its size.
  • "100x200px": Scales the image to be no wider than 100 pixels and no higher than 200 pixels. Image will keep its original aspect ratio.
  • (nothing specified): Uses the size specified in preferences for logged in users, uses a size determined by resolution for anonymous users.

Caption

Any element which cannot be identified as one of the above is assumed to be caption text.

Syntax to use an image in uploaded size, with a caption

To use an image as uploaded with a caption use [[Image:Tstgal2.png|frame|none|caption text]]. This is the syntax you should use to update images that used the original image markup of the form [[Image:Tstgal2.png|caption]]

caption text

Syntax for images with no automatic caption or formatting

The old syntax for images without captions is [[Image:Tstgal2.png|alt text]]. This is rendered inline, and the specified text is used as the image's alt attribute (alternate text for programs which cannot display images, such as screen readers) and as the title attribute (supplementary text, often displayed as a tool tip when the mouse is over the image).

Example

alt text

New syntax for images

King Charles II
The new syntax is backward compatible, so articles don't have to be changed. In the syntax [[Image:filename|options]] (e.g. [[Image:Tstgal2.png|thumb|100px|left|King Charles II]] shown in the left), several options can be set when including an image. Those affect the placing of the image, its size or the way the image will be presented. The options are right, left, center, none, sizepx, thumbnail (thumb), frame, and alternate (caption) text.
King Charles II
  • The options can be combined, and vertical bars ("|") are used to separate options from each other.
  • Do not put spaces around the vertical bars for readability – options will not be interpreted correctly.
  • The options can be put in any order.
  • An unknown option is taken as the caption text, but this seems to appear only if thumbnail is specified.
  • If there are two or more unknown options, the last one upstages the rest: [[Image:Tstgal2.png|thumb|King Charles II|200px|right]] (shown on the right).

Here is the description of the options other than the caption text:

right 
Tstgal2.png
The image is right-aligned, and text floats to the left of the image: [[Image:Tstgal2.png|right|70px|]] (shown on the right).
left 
Tstgal2.png
The image is left aligned, and text floats to the right of the image: [[Image:Tstgal2.png|left|70px|]] (shown on the left).
center 
The image is centered, and...
Tstgal2.png
the text following the image starts below it: [[Image:Tstgal2.png|center|70px|]] (shown above).
none 
The image is put at the left, and...
Tstgal2.png
the text following does not float to the right (or to the left, obviously), and starts below it: [[Image:Tstgal2.png|none|70px|]] (shown above).


Notes:
Tstgal2.png
The above four options are incompatible. When used combined, the last one overrides the rest: [[Image:Westminstpalace.jpg|none|right|center|left|70px|]] (shown on the left).
Tstgal2.png
What is between the last vertical bar and the closing brackets ("]]"), void or not, is taken as the last option, and works as usual. For instance, when the last option is right, the image is right-aligned, and text floats to the left: [[Image:Tstgal2.png|70px|right]] (shown on the right).
Tstgal2.png
This text is displayed.
In particular, if the last option is the void text (that is, if there is nothing between the last vertical bar and the closing brackets), the caption is not displayed: [[Image:Tstgal2.png|thumb|This text is not displayed.|70px|left|]] (shown on the left) and [[Image:Tstgal2.png|thumb|This text is displayed.|70px|right]] (shown on the right).
sizepx 
Tstgal2.png
This option renders a version of the image that's [size] pixels wide (e.g. [[Image:Tstgal2.png|right|50px|]] shown on the right). Height is computed to keep aspect ratio (i.e. the shape of the image).
Notes:
Specifying a size does not just change the apparent image size using HTML; it actually generates a resized version of the image on the fly and links to it appropriately. This happens whether or not you use size in conjunction with thumb.
This means the server does all the work of changing the image size, not the web browser of the user. By having the server do all the work means faster downloading of pages. It also means that larger images can be stored on the server without any slowdown by the browser (especially on dial up telephone lines.) Only the data for the actual size on the page is transmitted.
The default thumbnail width can be set in the preferences, so it is recommended not to specify "px", in order to respect the users' preferences (unless, for a special reason, a specific size is required regardless of preferences, or a size is specified outside the range of widths 120–300px that can be set in the preferences).
If you specify a "frame" option the image will not be scaled, and no size specifiers will be in the HTML. The image will be rendered at full size.
Tstgal2.png
When there are two or more "size" options, only the last one is valid: [[Image:Tstgal2.png|right|50px|80px]] (shown on the right).
thumbnail, thumb 
Tstgal2.png
[[Image:Tstgal2.png|thumb|King Charles II]The thumbnail (thumb) option generates a thumbnail image. It is automatically resized when the "size" attribute is not specified. Without the options left, center, and none, the image is normally on the right. If the image has a caption text, it is displayed in the lower margin. E.g. [[Image:Tstgal2.png|thumbnail|left|100px|]] (shown on the left) and [[Image:Tstgal2.png|thumb|King Charles II]] (shown on the right). Note: thumbnail (thumb) cannot be used in lists.
frame 
King Charles II
With this option, the embedded image is shown with its actual size enclosed by a frame, regardless of the "thumb" or "size" attribute, and the caption, if any, is visible in the frame. Without the options left, center, and none, the image is normally on the right: [[Image:Tstgal2.png|frame|thumbnail|50px|King Charles II]].

With none of the options other than sizepx and alternate (caption) text, an embedded image is rendered inline.

text text text text text text
[[Image:Tstgal2.png|150px|King Charles II]]
text text text text text
text text text text

gives

text text text text text text King Charles II text text text text text text text text text

The option none can be used to have thumbnails without left- or right-alignment. This is probably most useful for tables. This is an example:

How to use none
English Monarchs
King Charles II
Charles II
[[Image:Tstgal2.png|thumb|none|100px|Charles II]]
King James II
James II
[[Image:James.jpg|thumb|none|100px|James II]]


Linking to the image description page

If you want to make a link to the description page for an image, use a leading colon before "image:" in an intra-wiki link, like this: [[:Image:Tstgal2.png|Charles II]] which yields: Charles II

Image galleries

See Help:Images

See also

Personal tools
Namespaces
Variants
Actions
Navigation
Starting Guide
Setting
Other
Toolbox