Image commands
From Allotments4All
Contents
Gallery format
Table format
More details and examples on embedding internal images into articles
To include an uploaded image in a page, use a link in the form [[image:filename.jpg]] or [[image:filename.png|alt text]]. For uploaded sound files, you can include the download link in a page with [[media:filename.ogg]].
Example: Using [[Image:Broccoli-thumbnail.png]], the image Broccoli-thumbnail.png is included (broccoli is an edible vegetable):
If the wiki is set to another language than English, the name of the "Image:" namespace might be changed. For German, for example, it's [[Bild:Broccoli-thumbnail.png]]
Alternate Text
By specifying alternate text, you can make the article accessible to the blind, too. You can specify an alternate text after a "|"-sign, e.g. [[Image:Broccoli-thumbnail.png|A cartoon drawing of broccoli]], which will look like this:
Layout and resizing
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.
The options can be combined, and vertical bars ("|") are used to separate options from each other. The options can be put in any order. An unknown option is taken as the caption text. If there are two or more unknown options, the last one upstages the rest: [[Image:Broccoli-thumbnail.jpg|thumb|Canterbury Tales|80px|left|A cartoon drawing of broccoli]]. This is shown on the left; the caption is "A cartoon drawing of broccoli", not "Canterbury Tales".
Here is the description of the options other than the caption text:
- right
- makes the image right-aligned, and text floats to the left: [[Image:Broccoli-thumbnail.jpg|right|70px|]] (shown on the right).
- left
- The image is left aligned, and text floats to the right of the image: [[Image:Broccoli-thumbnail.jpg|left|70px|]] (shown on the left).
- center
- The image is centered, and...the following text starts below it: [[Image:Broccoli-thumbnail.jpg|center|70px|]] (shown above).
- none
- The image is put at the left, and...the following text does not float to the right or (naturally) to the left, and starts below it: [[Image:Broccoli-thumbnail.jpg|none|70px|]] (shown above).
- Notes:
- The above four options are incompatible. When used combined, the last one overrides the rest: [[Image:Broccoli-thumbnail.jpg|none|right|center|left|70px|]] (shown on the left).
- 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:Broccoli-thumbnail.jpg|70px|right]] (shown on the right).
- 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:Broccoli-thumbnail.jpg|70px|right]] (shown on the right).
- 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:Broccoli-thumbnail.jpg|thumb|This text is not displayed.|70px|left|]] (shown on the left) and [[Image:Broccoli-thumbnail.jpg|thumb|This text is displayed.|70px|right]] (shown on the right).
- 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:Broccoli-thumbnail.jpg|thumb|This text is not displayed.|70px|left|]] (shown on the left) and [[Image:Broccoli-thumbnail.jpg|thumb|This text is displayed.|70px|right]] (shown on the right).
- sizepx
- renders a version of the image that's [size] pixels wide (e.g. [[Image:Broccoli-thumbnail.jpg|right|50px|]] shown on the right). Height is computed to keep aspect ratio (i.e. the shape of the image).
- Note: When there are two or more "size" options, only the last one is valid: [[Image:Broccoli-thumbnail.jpg|right|50px|80px]] (shown on the right).
- Note: When there are two or more "size" options, only the last one is valid: [[Image:Broccoli-thumbnail.jpg|right|50px|80px]] (shown on the right).
- thumbnail, thumb
- 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:Broccoli-thumbnail.jpg|thumbnail|left|100px|]] (shown on the left) and [[Image:Broccoli-thumbnail.jpg|thumb|The Palace of Westminster]] (shown on the right).
- frame
- 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:Broccoli-thumbnail.jpg|frame|thumbnail|50px|A drawing of broccoli]].
With none of the options other than sizepx and alternate (caption) text, an embedded image is rendered inline. Note that the size of the inline images can be reduced but they can not be enlarged.
text text text text text text [[Image:Broccoli-thumbnail.jpg|150px|A drawing of broccoli]] text text text text text [[Image:The Earth seen from Apollo 17.jpg|100px|This is a globe.]] text text text text
gives
text text text text text text text text text text text text text text text