Use this plugin to control the display and alignment of images using an easy
syntax and support for server-side resizing and thumbnailing. There are a set
of pre-defined layout formats for images as well as a free layout configurability.
Short example: You type:
at the location specified in the IMAGEALBUM preference variable,
at the current topic or
at a remote URL.
If you specify a remote url using http://... the image is downloaded (using CPAN:LWP::Simple)
into a local cache and then processed as usual. WARNING: please be aware of any copyrights of
the images you mirror this way.
The topic and IMAGEALBUM parameters can be of the for [<web>.]<topic> .
For example putting
* Set IMAGEALBUM = TWiki.ImagePlugin
into the current topic will search all images at the given topic.
Syntax
%IMAGE{"foo.gif" ...}%
There are four predefined format types (simple, link, thumbnail, frame, float)
that can be used by setting the type paramenter (see below). In addition
there is a free-form format parameter to specify any other possible html
layout. The Wikipedia format is also supported. See
Wikipedia:Wikipedia:Extended_image_syntax.
(hidden feature: %IMAGE{"clear"}% will create a proper clear for your floats )
Arguments
The image name is mandatory. Further arguments are optional.
javascript executed if moving the mouse over the image
empty
mouseout
javascript executed if moving the mouse off the image
empty
size
geometry specification
image geometry
style
(see html specs)
empty
title
title text
alt value
topic
valid TWiki topic name
topic part of IMGALBUM value or current topic
type
simple|link|thumb[nail]|frame|float"
empty
web
valid TWiki web name
web part of IMGALBUM value or current topic
width
integer value
image width
warn
on/off, surpress error warnings
on
Image geometry
The image geometry in the size parameter can be specified in a format
<width>[px][x<height>[px]],
that is width and height can be given as integers with an optional px, where
the height is optional, separated with a 'x' in between. Note, that the given
width and height values are the maximum width and maximum height that the
image will have keeping its aspect ratio. If you want to deform it to an extact
measure use the width and height arguments.
Format specification
Format strings given in header, footer and format may contain the following
pseudo variables:
link text to be displayed in the "link" layout type
$title
value of title argument
$width
image width
After the layout has been formatted any further TWiki markup that might be
contained is expanded afterwards. Note, that using $percnt and $dollar
evaluation order of TWiki markup can be changed so that arguments are expanded
after the IMAGE tag has been computed, whereas TWiki's default evaluation
order is left-to-right-inside-out.
Examples
%IMAGE{"foo.gif" size="100" align="left" caption="This is my caption"}% (resize to 100 pixels, text flows right, with caption)
%IMAGE{"foo.gif" type="thumb" align="center"}% (Resize to %IMGPLUGIN_THUMBNAIL% size, and center image)
Plugin Installation Instructions
Download the ZIP file
Unzip ImagePlugin.zip in your twiki installation directory. Content:
Optionally, run ImagePlugin_installer to automatically check and install other TWiki modules that this module depends on. You can also do this step manually.
Alternatively, manually make sure the dependencies listed in the table below are resolved. %$DEPENDENCIES%
Configure the Plugin:
TWiki 4.0 and up: Run the configure script to enable the Plugin
make implementation of image mage configurable, defaulting to Graphics::Magick as Image::Magick has got issues using perl accellerators like mod_perl, speedy-cgi
03 Jan 2008:
added processing of remote images
18 Dec 2006:
fixed image lookup order; fixed html formats; added I18N workaround
18 Aug 2006:
fixed html errors; removed references to ImgPlugin thus not showing the magnify-clip; some html and css fixes to resemble closer to the MediaWiki examples
17 Aug 2006:
width and height arguments had no effect; floating images not clearing proberly on IE