Image Ingestion
When articles are ingested, the set of accompanying images are scaled, compressed, and converted into PNG format. Currently the set of images is hard coded to accomodate what the PLOSONE application requires. In the future, we may expand the functionality to allow more generic batch processing of images.
The images are converted by the ImageMagick? command line processor.
Configuration
Image batch processing can be configured under the <utilities><image-magik> element in global-defaults.xml. Here is an example configuration:
<utilities>
<image-magick>
<executable-path>/usr/bin/convert</executable-path>
<identify-path>/usr/bin/identify</identify-path>
<temp-directory>/tmp</temp-directory>
<imageSetConfigs>
<imageSet name="#default">
<small width="70" quality="70"/>
<medium maxDimension="600" quality="80"/>
<large quality="95"/>
</imageSet>
<imageSet name="compressedLargeImages">
<large quality="50"/>
</imageSet>
</imageSetConfigs>
</image-magick>
</utilities>
Inside <imageSetConfigs>, a number of <imageSet> configurations may be defined. Each one may be referenced by name in order to batch process images. These are currently referenced from the <articleTypeList> definitions in defaults.xml via the <imageSetConfigName> element. The imageSet properties are applied to all images ingesting as Article of the associated ArticleType.
The reserved name #default can be used to define a default set of properties. The default imageSet provides property values for any attributes that are not defined in another imageSet. The default imageSet is also used when no imageSetConfigName is defined for an ArticleType. For instance, in the imageSet above called compressedLargeImages, the "maxDimension" attribute for medium images shall be derived from the "#default" imageSet to be "600". The "quality" attribute for large images is explicitly defined however and hence shall be "50".
Each imageSet defines 3 image types. Within each, only the following properties are supported:
| image type | attribute name | application of attribute |
| small | Used in the article pages and as links throughout the publishing application | |
| width | The image is scaled proportionately to 'width' pixels | |
| quality | The image is compressed to this quality. 100 == no compression. 0 == maximum compression | |
| medium | Used in the slide-show presentation | |
| maxDimension | The image is scaled proportionately so it is no larger than in width or height than this size in pixels | |
| quality | The image is compressed to this quality. 100 == no compression. 0 == maximum compression | |
| large | Used to display large images from the slide-show | |
| quality | The image is compressed to this quality. 100 == no compression. 0 == maximum compression |
Future Considerations
A more generic utility for image conversion might be implemented in the future. Each image set could define a collection of image types to be created. The attributes in each image type should declare what type of processing should be performed upon the generated image. We will need to carefully choose a minimal set of useful operations for a publishing application. We will also need to specify a naming convention for each generated image type so that it can be referenced correctly.
