Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ICC Profiles

PDFs optimized for physical printing most probably often use the CMYK color schemes. While most Printers work with CMYK colors, monitors use RGB color schemes. From this it follows that it is a good idea to convert CMYK color schemes to RGB when creating thumbnail images. Furthermore color space. On the web, however, the de facto color system is sRGB. By default, DSpace's ImageMagick-based thumbnailing system will create thumbnails that use the same color space as the source PDF. Most web browsers are not able to correctly display images that use the CMYK color space, which leads to images with visibly inaccurate colors. Furthermore, the JSPUI currently does not support thumbnails using the display of thumbnails that use the CMYK color schemes space (see DS-2834).

If you are using Ghostscript ( version 9 or above), DSpace can create thumbnails that use RGB even if the source PDF was using CMYK. For the transformation from CMYK to RGB Ghostscript needs ICC profilesit is possible for DSpace to correctly convert images from CMYK to sRGB by providing it with appropriate ICC color profiles to use during thumbnail creation. Default ones are provided by most Ghostscript installations (version 9 or above). The following configuration options tell DSpace where those ICC profiles are located.

...

Providing ICC profiles to ImageMagick is optional. If these configuration properties are unset, no profiles will be supplied to ImageMagick, and thumbnails produced from PDFs using the CMYK color scheme space will also use CMYK as color scheme too. While the . The transformation from CMYK to RGB is optional, but keep in mind that thumbnails using CMYK will make troubles cause problems if you use JSPUI and display thumbnails within browsing on browse and search pages (see DS-2834).

Additional Customization

The ImageMagick conversion software provides a large number of conversion options.  Subclasses   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.

Possible Errors / Issues

"convert.im6: not authorized" errors

On Ubuntu (possibly other OSes), you may see errors like these when attempting to generate PDF thumbnails:

Code Block
ERROR filtering, skipping bitstream:
        Item Handle: 1234/5678
        Bundle Name: ORIGINAL
        File Size: 30406135
        Checksum: c1df4b3a4755e9bed956383b61fc5042 (MD5)
        Asset Store: 0
org.im4java.core.CommandException: org.im4java.core.CommandException: convert.im6: not authorized `/tmp/impdfthumb6294641076817830415.pdf' @ error/constitute.c/ReadImage/454.


These may be caused by a change in your ImageMagick policy configuration on your server. 

In Ubuntu, the default "policy.xml" was recently updated to exclude all Ghostscript formats (including PDF, PS, etc).  See this ticket: https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1796563

The newly added lines in the /etc/ImageMagick/policy.xml are these ones:

Code Block
<!-- disable ghostscript format types -->
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="EPS" />
<policy domain="coder" rights="none" pattern="PDF" />
<policy domain="coder" rights="none" pattern="XPS" />

If you wish to re-enable ImageMagick to process Ghostscript format types, you can simply comment out those lines in the configuration file.  Be aware that, as the fix to this vulnerability is not yet verified, you should only do so at your own risk.