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
This behaviour makes sense, really. Just think about it - by escaping the EOL, we're telling the parser it should disregard the EOL. And what is a comment? EOL followed by #. Since there is now no EOL, there is no indication of a comment, thus what follows is part of the value. Just my 2 cents.