DS-2105: Create Thumbnails Using ImageMagick 

Clean version of https://github.com/DSpace/DSpace/pull/597

This code uses ImageMagick and Ghostscript to generate DSpace thumbnails of higher quality than the out-of-the-box capability of DSpace. Ghostscript allows DSpace's media filter to generate thumbnails from PDF bitstreams (similar to the XPDF method mentioned in the DSpace Manual, but with higher quality).

Installation Dependencies

This solution requires ImageMagick and Ghostscript to be installed on the server where DSpace is running. Each of these utilities must exist in DSpace's runtime path. These applications will be run from the command line.

Build Dependencies

This solution adds a build dependency on im4java

Configuration

Changes needed in DSpace configuration file, dspace.cfg:

plugin.named.org.dspace.app.mediafilter.FormatFilter = \
    org.dspace.app.mediafilter.LitImageThumbnailFilter = LIT Image Thumbnail, \
    org.dspace.app.mediafilter.LitPdfThumbnailFilter = LIT PDF Thumbnail, \

filter.org.dspace.app.mediafilter.LitImageThumbnailFilter.inputFormats = BMP, GIF, image/png, JPG, TIFF, JPEG, JPEG 2000
filter.org.dspace.app.mediafilter.LitPdfThumbnailFilter.inputFormats = Adobe PDF

# GU ImageMagick Customizations
org.dspace.app.mediafilter.LitImageMagickThumbnailFilter.ProcessStarter = /usr/bin
org.dspace.app.mediafilter.LitImageMagickThumbnailFilter.ThumbnailWidth = 180
org.dspace.app.mediafilter.LitImageMagickThumbnailFilter.ThumbnailHeight = 120
The JRE documentation is unclear, but by experiment it seems that this is a JRE limitation, not DSpace's.  Properties.load() does not understand comment lines within a logical line consisting of multiple natural lines.  Such comment lines are treated as part of the value.  The advice should be re-worded regardless, and we should fix any other such advice.