| Name | Jmage Plugin |
|---|---|
| Vendor | Simon Mittag (Website) |
| Authors | Simon Mittag |
| Homepage | http://confluence.atlassian.com/display/CONFEXT/JMAGE+Plugin |
| Issue Management | http://developer.atlassian.com/jira/browse/JMG |
| Continuous Integration | n/a |
| Categories | Content Macros |
| Most Recent Version | 0.3 |
| Availability | Confluence v2.3 to v2.10 |
| State | Beta |
| Support |
|
| License | Freeware / Open Source (BSD) |
| Price | Free |
| Release Docs | http://confluence.atlassian.com/display/CONFEXT/jmage+plugin |
| Java API Docs | n/a |
| Download Source | http://svn.atlassian.com/svn/public/contrib/confluence/jmage-plugin/tags/0.3/ |
| Download JAR | jmageconfluenceplugin-0.3-conf.jar |
News
- 0.3 has been released for compatibility testing.
- It now depends on jmage 0.6.1 which is free of native library dependencies.
- Plugin is now repackaged for confluence 2.3 to be self contained.
- Dropped TIFF and BMP encoding support for confluence, was irrelevant for webapp anyway since browsers don't understand them.
- Should work with plugin repository but not tested yet, need to check with Jonathan Nolen?
Description/Features
The plugin allows filtering confluence image attachments through JMAGE filterchains, modifying the image at runtime before returning it to the browser.
Amongst other things, this will allow you to dynamically resize, sharpen, greyscale, rotate, blur your image and include the results in your wiki page. Jmage-plugin is made of a servlet plugin that delegates image requests to the JMAGE ServletMapper and a macro plugin which makes that easier to invoke. You can select arbitrary filter combinations for each attachment, but since images are rendered at runtime you never lose the original. Don't like something? Just change the filter order or parameters and adjust it. In short, the JMAGE plugin adds on-the-fly image modification capabilities to confluence.
Quick Reference
{jmagefilter:attachment=image.jpg|encode=gif}
filter:property=value;anotherproperty=anothervalue;
anotherfilter:property=value;
yetanotherfilter
{jmagefilter}
attachment: name of the existing page attachment
encode: [gif | png | jpg | bmp], the target image format.
filter: name of a jmage filter. Each filter goes on a new line in the macro body. Filters mark up properties with a colon ":" and concatenate multiple properties with a semicolon ";"
Requirements
Should now work out of the box everywhere in confluence 2.3.
Documentation
The jmagefilter macro tag wraps all image request to attachments. Let's have a look at a few examples and start with the original image.

This will brighten the image by 10%.
{jmagefilter:attachment=harbour.jpg}
brighten:adjust=10
{jmagefilter}

This will brighten the image by 10%, then drop a shadow around it.
{jmagefilter:attachment=harbour.jpg}
brighten:adjust=10
shadow
{jmagefilter}

A more complex example. The image is brightened, then run through a sepia filterchain, then a shadow filterchain and finally rotated by 10 degrees. Bear in mind that the more filters you run an image through, the longer it takes to render the result.
{jmagefilter:attachment=harbour.jpg}
brighten:adjust=10
sepia
shadow
xrotate:orientation=10
{jmagefilter}

Filters in jmage
Use the table as a quick reference to filters. For a full list of their parameters, check the jmage taglib documentation and select a filter name.
| Short name | Type | Description |
|---|---|---|
| brighten | filter | brightens the image |
| colorize | filter | gives a color tint |
| darken | filter | darkens the image |
| background | filter | sets a background image |
| overlay | filter | overlays the image with another one. |
| text | filter | allows writing text on an image |
| resize | filter | bicubic resize operation |
| smartresize | filter | resizes while keeping aspect ratio |
| border | filter | draws a border |
| crop | filter | crops pixels from the canvas |
| rotate | filter | rotates the image |
| xrotate | filter | rotates and auto-extends the canvas |
| blur | filter | gaussian blur filter |
| sharpen | filter | sharpens the image |
| unsharpmask | filter | unsharpmask subtracts a blurred version of the image from itself |
Filterchains in jmage
Filterchains from classpath are broken in 0.3, there is no fix yet |
Filterchains are more complex operations. A few examples are built into JMAGE 0.5 to illustrate. It's easy to write your own filterchains and include them in confluence.
| Short name | Type | Description |
|---|---|---|
| [sepia] | filterchain | turns an image into a tinted, blurred, black and white version of itself |
| [instantphoto] | filterchain | converts an image into a polaroid version of itself. |
| [woodenframe] | filterchain | frames an image in a massive wooden frame |
| [plasmatv] | filterchain | converts an image into a tv showing this image |
Version History
| Version | Comments |
|---|---|
| 0.3 | Upgrade to confluence 2.3.1 |
| 0.2 |
|
| 0.1 |
|


Comments (15)
Nov 21, 2005
Guy Fraser says:
I'm sure the Java community has ESP. I was just about to ask for something like ...I'm sure the Java community has ESP. I was just about to ask for something like this. Will this enable us to, for example, allow clients to upload mahoosive image attachments from their digital camera (as many will not know how to use image editing software to shrink them down) and have the images rescaled to a more managable filesize before inclusion on a page?
Nov 21, 2005
Jonathan Nolen says:
Don't know a whole lot about this, but it seems likely. Hopefully Simon will chi...Don't know a whole lot about this, but it seems likely. Hopefully Simon will chime in and update us on his progress.
Nov 24, 2005
Simon Mittag says:
Guy, yes that's the idea. You upload your image as an attachment and there...Guy,
yes that's the idea. You upload your image as an attachment and there's a resize filter you can use on the page to scale to proportions before sending it to the client. I need a couple of days until everything will be up here, including the docs, so "watch this space"
Cheers,
Simon
Nov 25, 2005
Guy Fraser says:
Simon, If you need help with the docs, let me know: gfraser@adaptavist.comSimon,
If you need help with the docs, let me know: gfraser@adaptavist.com
Nov 27, 2005
David Peterson [CustomWare] says:
Hey Simon - very cool! Have you considered putting the filter chain into the ma...Hey Simon - very cool!
Have you considered putting the filter chain into the macro body, rather than squeezing it into a parameter. Eg, your complex example above could be something like this:
{jmagefilter:attachment=harbour.jpg} brighten:adjust=10 sepia shadow xrotate:orientation=10 {jmagefilter}Or, if you want it all on a single line:
{jmagefilter:attachment=harbour.jpg}brighten:adjust=10 > sepia > shadow > xrotate:orientation=10;otherparameter=X{jmagefilter}It seems more readable to me, but other peoples' mileage may vary. Of course, it's quite possible that there are restrictions which prevent this from working.
Either way, looking forward to further updates.
Nov 27, 2005
Guy Fraser says:
That would certainly make using the macro easier from the content author's point...That would certainly make using the macro easier from the content author's point of view - much easier to understand and see what's happening.
Nov 27, 2005
Simon Mittag says:
yup that sounds like a good idea. I'll look into it.yup that sounds like a good idea. I'll look into it.
Dec 04, 2005
Simon Mittag says:
0.2 with body tags and a few fixes is online.0.2 with body tags and a few fixes is online.
Dec 04, 2005
Simon Mittag says:
I could also use some help documenting the filters, if anyone is interested in d...I could also use some help documenting the filters, if anyone is interested in doing so. They are basically the same than the tag params in the jmage jsp taglib, except the javascript attributes and a few naming issues. Would appreciate if someone would test it though.
Dec 05, 2005
Bob Swift says:
Can anybody point me to PowerPC Linux versions of the JAI and JAI-IMAGEIO packag...Can anybody point me to PowerPC Linux versions of the JAI and JAI-IMAGEIO packages?
Dec 06, 2005
Simon Mittag says:
Bob, I haven't gotten around to test JMAGE on linux yet. Solaris and Win32 versi...Bob, I haven't gotten around to test JMAGE on linux yet. Solaris and Win32 versions are confirmed working.
http://archives.java.sun.com/cgi-bin/wa?A2=ind0207&L=jai-interest&D=0&P=4403#TOP these people suggest to use the software only version for linux. If you try JAI it out in software mode you probably will have to increase your confluence heap size to cater for memory hungry image processing.
Let me know how you go.
May 23, 2007
Harry Timons says:
Any chance to get a "resize" option where I can define the width only, and the h...Any chance to get a "resize" option where I can define the width only, and the height will be set accordingly (= keeping aspect ratio)?
The difference to the "smartresize" option would be that there are no autocroppings as necessary - but the height would be in ratio to the defined width.
Many thanks for feedback, br harry
Aug 27, 2007
Paco says:
Great plugin. It'd be great if it can get a little push from beta to release. In...Great plugin. It'd be great if it can get a little push from beta to release. In particular support for filterchains (as in the sepia and shadow examples) would be extremely handy. Any idea if that's happening any time soon?
Aug 27, 2007
Paco says:
.. I just discovered that JMAGE images do not appear when exporting to PDF.. I ...Jan 22, 2008
vikas says:
Hi Simon I am trying to put background image using JMAGE but it doesnt work ...Hi Simon
I am trying to put background image using JMAGE but it doesnt work
I am using confluence 2.7
Is it possible for you to please write the correct syntax , may be i am using the wrong one
Thanks in advance
Vikas Bhardwaj