]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/img.mdwn
* Response
[ikiwiki.git] / doc / plugins / img.mdwn
1 [[!template id=plugin name=img author="Christian Mock"]]
2 [[!tag type/chrome]]
3
4 This is an image handling plugin. While ikiwiki supports inlining full-size
5 images by making a [[ikiwiki/WikiLink]] that points to the image, using
6 this plugin you can easily scale down an image for inclusion onto a page,
7 providing a link to a full-size version.
8
9 This plugin uses the [ImageMagick](http://www.imagemagick.org/) tools via
10 [PerlMagick](http://www.imagemagick.org/www/perl-magick.html).
11
12 Note that this is a stripped down version of Christian Mock's
13 [[original_img_plugin|contrib/img]].
14
15 ## usage
16
17         \[[!img image1.jpg size="200x200" alt="clouds"]]
18
19 The image file will be searched for using the same rules as used to find
20 the file pointed to by a [[ikiwiki/WikiLink]].
21
22 The `size` parameter is optional, defaulting to full size. Note that the
23 original image's aspect ratio is always preserved, even if this means
24 making the image smaller than the specified size.
25
26 You can also pass `alt`, `title`, `class` and `id` parameters. These are
27 passed through unchanged to the html img tag. If you include a `caption`
28 parameter, the caption will be displayed centered beneath the image.
29
30 The `link` parameter is used to control whether the scaled down image links
31 to the full size version. By default it does; set "link=somepage" to link
32 to another page instead, or "link=no" to disable the link, or
33 "link=http://url" to link to a given url.
34
35 You can also set default values that will be applied to all later images on
36 the page, unless overridden. Useful when including many images on a page.
37
38         \[[!img defaults size=200x200 alt="wedding photo"]]
39         \[[!img photo1.jpg]]
40         \[[!img photo2.jpg]]
41         \[[!img photo3.jpg size=200x600]]