This plugin allows one to upload an large image e.g. from your digicam and have them resized on the server to save bandwith.\\
As it is a copy of the [ImagePlugin] and the AttachementServlet the handling is very similar to them.

I have had to copy them as the current structure doesnt allow me to clean inherit them. If you like this plugin, but want a cleaner solution, i could change the ImagePlugin and the AttachementServlet accordingly.

__Newest version: [imagex-0.6.jar] 2004-09-09__
Use the jspwiki work directory for the persistent cache. This simplifies the configuration a little bit. Though, you could still use the "imageCache" parameter to override this behaviour.

__Usage__

* resize
{{{ [{ImageX src='P7100003.JPG' width='640'}] }}}

* convert
{{{ [{ImageX src='P7100003.JPG' width='640' type='image/x-png'}] }}}

* rotate
{{{ [{ImageX src='P7100003.JPG' width='640' rotate='90'}] }}}


and all other parameters provided by the [ImagePlugin].
If you omit one of width/height the picture is resized by save its proprtions.

__Installation__

0. remove your old imagex.jar or imagex-x.y.jar

1. drop imagex-x.y.jar into WEB-INF/lib

2. if wanted, add 'org.stringfellow.jspwiki' to your plugin search path:\\e.g {{{jspwiki.plugin.searchPath = org.stringfellow.jspwiki}}}

3. Add the image resizer servlet to your web.xml
{{{
   <servlet>
       <servlet-name>ImageServlet</servlet-name>
       <servlet-class>org.stringfellow.jspwiki.imagex.ImageServlet</servlet-class>       

       <init-param>
           <param-name>useCache</param-name>
           <param-value>true</param-value>
       </init-param>
       <init-param>
           <param-name>imageLifetime</param-name>
           <param-value>30</param-value>
       </init-param>

   </servlet>
   <servlet-mapping>
       <servlet-name>ImageServlet</servlet-name>
       <url-pattern>/imageServlet</url-pattern>
   </servlet-mapping>
}}}   

4. configure the servlet parameters:\\
useCache (required if you want to use a cache): true/false
imageCache (optional): the path where the images should be cached.
	set it if you dont want to use the jspwiki work direcotry.
imageLifetime (optional): if the image wasnt accessed for the given number of days it will be deleted from the cache

5. if you are on an unix box and do not have/do not want to use an x11 server - you could add
{{{-Djava.awt.headless=true}}}to your application-server startup script (if not already done so)

__See also__

[http://l3x.net/imwiki/] there you will find the source and watch the plugin in action

!Discussion

Note that in 2.1 CVS JSPWiki provides a directory for cache usage.  You can also use OSCache for caching things...  --JanneJalkanen

Thanks! 0.6 now uses this directory.  I have to dig into OSCache to see if it is able to handle my needs.
--MarioIvankovits

Just noticed that ImageX only works with the standard URL form of /Wiki.jsp?page=MyPage. If you use the [ShortURLConstructor] then the src HREFs produced by the plugin don't match with the url required by the image servlet.
--[DaveSB]
----------
Just some ideas:\\
Especially for MereMortals who don't know how to resize images, this could be an ease of use: What would be helpful is that you could indicate in jspwiki.properties an max-image-width. If you put the image name in brackets (inline syntax), the ImageX plugin could be used to resize the image in case it's original width exeeds the max-image-width value, so the layout does not get screwed.

This normally happens if a MereMortal uploads his 6 Megapixel Image directly from his DigiCam. On clicking on that image the original sized image gets displayed (something thats missing in the current Implementation of the ImageXPlugin.) 
--''[Christoph Sauer]''

Ok, i've just modified the ~ImageX.jpg a little bit. If you now click on the image, and no link is provided it will point to the originally sized image. I used the 0.7 source of Mario.

* [Modified ImageX.java|ImageX.java]

-- ''ChristophSauer, 11-Nov-2005''

Updated my ImageX modification to use an absolute URL to link to the generator servlet as workaround for a [bug in the new ShortURLConstructor|Bug Short URL Constructor Does Not Work With Relative Inter Wiki Links]. You have to set the baseURL for this to work in the jspwiki.properties.

-- ''ChristophSauer, 10-Feb-2006''