This documentation relates to an old version of DSpace, version 5.x. Looking for another version? See all documentation.
ImageMagic Media Filters
The ImageMagick Media Filters provide consistent, high quality thumbnails for image bitstreams and PDF bitstreams.
These filters require a separate software installation of the conversion utilities (ImageMagick and Ghostscript).
The media filters use the library im4java to invoke the conversion utilities. This library constructs a conversion command launches a sub-process to perform the generation of media files.
- Install ImageMagick on your server
- If you wish to generate PDF thumbnails, install Ghostscript on your server
- The ImageMagick and Ghostscript executables should be accessible from the same directory (e.g.
In the filter.plugins section your dspace.cfg file, uncomment the ImageMagick media filter definition.
This will activate the following settings which are already present in dspace.cfg
These media filters contain the following configuration properties
The following properties are used to define the dimensions of the generated thumbnails.
Conversion Utility Path
The following property provides a path to the ImageMagick and GhostScript utilities.
Overwriting Existing Thumbnails
The The ImageMagick media filters can differentiate thumbnails created by the DSpace default thumbnail generator and thumbnails that were manually uploaded by a user. The media filter reads the bitstream description field to make this determination. A regular expression can be provided to define the set of thumbnails that should be overwritten by the ImageMagick thumbnail generator. Thumbnail descriptions matching this pattern will be overwritten even if the -f option is not passed to the filter media process.
The ImageMagick media filter will use the bitstream description field to identify bitstreams that it has created using the following setting. Bitstreams containing this label will be overwritten only if the -f filter is applied.
Thumbnail descriptions that do not match either of the patterns listed above are presumed to be manually uploaded thumbnails. These thumbnails will not be replaced even if the -f option is passed to the filter media process.
DSpaces uses JPEG as format for thumbnails. While JPEG doesn't support transparency, PDF, PNG and other formats does. As those formats are used as outgoing material in DSpace, DSpace has to care about transparency during the generation of the thumbnails. In combination of special versions of ImageMagick and Ghostscript it may occur, that completely transparent areas will become black. As solution ImageMagick recommends to flatten images extracted from PDFs before they are stored as JPEG. Since DSpace 5.2 the ImageMagick media filter flatten thumbnails extracted from PDFs. If you run in to problems you lead back to flattening of the extracted images, you can switch the flattening off by setting the following property in dspace.cfg to false:
The ImageMagick conversion software provides a large number of conversion options. Subclasses of these media filters could be written to take advantage of the additional conversion properties available in the software.
Note: The PDF thumbnail generator is hard-coded to generate a thumbnail from the first page of the PDF.