%IMAGE{"Sandbox/ImagePluginTest/Westminstpalace.jpg" type="frame" align="none" caption="caption text" }%You get: If installed: Images to be displayed can be located
topic
as specified,
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 = %SYSTEMWEB%.ImagePlugininto the current topic will search all images at the given topic.
%IMAGE{"foo.gif" ...}%
There are four predefined format types (plain, 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.
%IMAGE{"clear"}%
will create a proper clear for floats elements.
Name | Values | Default |
---|---|---|
align |
left|center|right|none | right |
alt |
alt text | image filename |
caption |
caption text | empty |
class |
(see html specs) | imageFrame, imageFloat, ... depending on the type |
desc |
description text | title text |
footer |
text to be appended to the html output | empty |
format |
image layout format string | set by type argument |
header |
text to be prepended to the html output | empty |
height |
integer value | image width |
href |
hyperlink when clicking on the image | url of the source image |
id |
(see html specs) | empty |
mousein |
javascript executed if moving the mouse over the image | empty |
mouseout |
javascript executed if moving the mouse off the image | empty |
refresh |
on/off/img to trigger recomputing images | off |
size |
geometry specification | image geometry |
zoom |
on/off to scale images, if set to "on" scaling up images is allowed, otherwise it downscales only | off |
style |
(see html specs) | empty |
title |
title text | alt value |
tooltip |
on/off | off |
tooltipwidth |
width of tooltip image | 300 |
tooltipheight |
height of tooltip image | 300 |
topic |
valid topic name | topic part of IMGALBUM value or current topic |
type |
simple, plain, link, thumb[nail], frame, float | plain |
warn |
on/off, surpress error warnings | on |
web |
valid web name | web part of IMGALBUM value or current topic |
width |
integer value | image width |
tooltip
argument allows rendering image previews in a tooltip. This option
only has effect if Foswiki:Extensions.JQueryPlugin is installed that comes with
the jquery.tooltip plugin used to render the image tooltip here.
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 exact
measure use the width
and height
arguments.
Note, that you must set zoom="on"
to scale images up. Otherwise images smaller
than the given geometry will stay as they are. For instance, when generating thumbnails
it is preferable to keep small icons as they are instead of bloating them up
to a standard thumbnail size.
header
, footer
and format
may contain the following
pseudo variables:
Name | Value |
---|---|
$align |
value of align argumet |
$alt |
value of alt argumet |
$caption |
caption text |
$class |
value of class argumet |
$desc |
value of desc argument |
$dollar |
replaced with dollar sign ($) |
$height |
image height |
$href |
hyperlink url when clicking on an image |
$id |
value of id argumet |
$magnifyIcon |
enlage-icon |
$mousein |
value of mousein argument |
$mouseout |
value of mouseout argument |
$n |
replaced with a linefeed (\n) |
$nop |
replaced with empty string |
$origheight |
image height of the original image |
$origsrc |
url of the original image (not the resized one) |
$origwidth |
image width of the original image |
$percnt |
replaced with percent sign (%) |
$src |
image source url |
$style |
value of style argumet |
$text |
link text to be displayed in the "link" layout type |
$title |
value of title argument |
$width |
image width |
$percnt
and $dollar
evaluation order of TopicMarkup can be changed so that arguments are expanded
after the IMAGE tag has been computed, whereas the default evaluation
order is left-to-right-inside-out.
resize
to generate thumbnails for image attachments
on the fly. This handler is then called in an img
tag like this:
<img src='%PUBURLPATH%/rest/ImagePlugin/resize? topic=web.topic; file=attachment; width=300; height=300' ... />Arguments to the
resize
handlers are:
Name | Values![]() |
Default |
---|---|---|
size |
geometry of thumbnail | |
height |
height of thumbnail | |
refresh |
on/off/img to trigger recomputing images | off |
file |
specifies the image filename | |
topic |
specifies the topic where the image is attached | BASEWEB.BASETOPIC |
zoom |
switch on/off upscaling | |
width |
width of thumbnail |
%IMAGE{"Westminstpalace.jpg" size="100" align="left" caption="This is my caption"}%
%IMAGE{"Westminstpalace.jpg" type="thumb" align="center"}%
$Foswiki::cfg{ImagePlugin}{RenderExternalImageLinks} = 1;This will download the image and mirror it on the local site. Use the
refresh
url parameter
to check if the external images has updated.
If you also turn on attaching a mirrored image to the current topic,
an additional attachment-record is generated for the downloaded external image.
Attachments will be marked as hidden. Note, that any
auto-attached image will update the topic and with it its timestamp.
$Foswiki::cfg{ImagePlugin}{AutoAttachExternalImages} = 1;
$Foswiki::cfg{ImagePlugin}{AutoAttachThumbnails} = 1;This might be of interest when you'd like to access these thumbnails using other plugins.
$Foswiki::cfg{ImagePlugin}{Mode} = 'Image::Magick';
configure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Plugin Author: | Craig Meyer, Foswiki:Main.MichaelDaum | ||||||||||||||||||
Copyright: | © 2006, Craig Meyer, © 2006-2010 Michael Daum http://michaeldaumconsulting.com |
||||||||||||||||||
License: | GPL (GNU General Public License) | ||||||||||||||||||
Release: | 2.31 | ||||||||||||||||||
Version: | 6307 (2010-02-12) | ||||||||||||||||||
Change History: | |||||||||||||||||||
12 Feb 2010: | made imagetooltip a proper jQuery plugin; using Foswiki:Extensions/ZonePlugin for faster page loads | ||||||||||||||||||
17 Nov 2009: | added zoom parameter; fixed manual refresh via url params |
||||||||||||||||||
24 Sep 2009: | updated imageplugin.template to help XHTML validation (stop rendering empty id attribute) |
||||||||||||||||||
14 Sep 2009: | using Foswiki's proxy settings instead of ENV; disabled tooltip previews for Internet Explorers | ||||||||||||||||||
18 Aug 2009: | removed bonus % in template (Foswiki:Main.AndreLichtsteiner, Foswiki:Main.WillNorris) |
||||||||||||||||||
24 Apr 2009: | converted to foswiki plugin; added thumbnail REST handler; added tooltip preview using jquery; added mirroring of external images; moved image type definitions into a template | ||||||||||||||||||
11 Feb 2009: | updated documentation examples (Foswiki:Main.WillNorris) | ||||||||||||||||||
07 Jan 2009: | certified for foswiki/compat | ||||||||||||||||||
03 Jul 2008: | fixed parsing the type parameter; fixing docu about the default THUMBNAIL_SIZE; added new default format plain ; plainify text to be used in a html attribute position, e.g. titles; default to no img alignment; refresh images on a ?refresh=on url param; using LWP::UserAgent instead of LWP::Simple to mirror images; using Resize instead of Scale for higher quality thumbnails; don't encrypt the href param |
||||||||||||||||||
03 Mar 2008: | 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 | ||||||||||||||||||
16 June 2006: | released into the public | ||||||||||||||||||
10 May 2006: | Initial version by forking ImgPlugin | ||||||||||||||||||
Dependency: | $Foswiki::Plugins::VERSION 1.1 | ||||||||||||||||||
CPAN Dependencies: |
|
||||||||||||||||||
Other Dependencies: | |||||||||||||||||||
Perl Version: | 5.8 | ||||||||||||||||||
Home: | Foswiki:Extensions/ImagePlugin | ||||||||||||||||||
Support: | Foswiki:Support/ImagePlugin |
![]() |
jquery.imagetooltip.js (0.65K)
Saved by install script
version 1 uploaded by AdminUser on 12 Feb 2010 - 23:22
|
![]() |
jquery.imagetooltip.js.gz (0.40K)
Saved by install script
version 1 uploaded by AdminUser on 12 Feb 2010 - 23:22
|
![]() |
Saved by install script
version 1 uploaded by AdminUser on 12 Feb 2010 - 23:22
|
![]() |
magnify-clip.png (0.26K)
Saved by install script
version 1 uploaded by AdminUser on 12 Feb 2010 - 23:22
|
![]() |
style.css.gz (0.41K)
Saved by install script
version 1 uploaded by AdminUser on 12 Feb 2010 - 23:22
|
![]() |
style.uncompressed.css (1.62K)
Saved by install script
version 1 uploaded by AdminUser on 12 Feb 2010 - 23:22
|
![]() |
WestminstpalaceSample.png (105.20K)
Saved by install script
version 1 uploaded by AdminUser on 12 Feb 2010 - 23:22
|