JAlbum pluggable image filters ------------------------------ JAlbum 3.3 is equipped with a flexible and extensible image filter mechanism. Java files implementing the se.datadosen.jalbum.JAFilter interface that is put in this directory can easily be plugged into the JAlbum image processing chain. A filter is preferrably plugged in using BeanShell scripts, either embedded in JAlbum template files or as stand alone files called "init.bsh", which can be placed inside skin directories or in the JAlbum program directory. Example. Put a file called "init.bsh" in the standard skin. Write the following to the file: engine.removeAllFilters(); TextFilter tf = new TextFilter(); tf.setPos(30,30); tf.setText("David: $originalDate"); engine.addFilter(tf,5); engine.addFilter(tf,3); engine.addFilter(new SimpleFilter(), 5); The BeanShell script above instansiates the TextFilter which allows you to, for example write watermark texts onto images. It is configured with a position and a text that utilizes the $variables that you might already know about. The filter is plugged into position 3 and 5 in the image process chain (se below) and finally a filter adding a logo in the corner of the image is addes to position 5. Image processing chain ---------------------- Filters can be plugged in five different positions/stages in the image processing chain. The position, where you plug them in affects if the filter is to affect closeups only, thumbnails only or both. Here are the stages: 1. Before initial scaling 2. After initial scaling 3. After initial scaling, but in a branch only intended for writing closeup images 4. Before thumbnail scaling 5. After thumbnail scaling The default stage is 2 so doing¨ engine.addFilter(new SimpleFilter()); will put a small logo to the closeup images and an even smaller logo to the thumbnails. If you instead would have done like this: engine.addFilter(new SimpleFilter(), 3); engine.addFilter(new SimpleFilter(), 5); Then the filter would have been applied twice, once to the closeups and once to the thumbnails