Uploaded image for project: 'Islandora'
  1. Islandora
  2. ISLANDORA-302

PDF thumbnail creation fails on certain PDF's on CentOS



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: PDF Solution Pack
    • Labels:


      There are issues with pdf CM relating to certain pdf's and certain versions of ImageMagick. The issue affects CentOS servers especially. Ubuntu servers are not currently affected due to the version of ImageMagick they are running.

      PDF's created by some applications e.g. Adobe Illustrator and Indesign are failing to create TN datastreams and producing a variety of errors on varying servers. This is most pronounced in CentOS 5.4 and 5.5. The result is that the ingest usually completes with errors but has no TN to display in the views.

      CentOS 5x by default is running Imagemagick 6.28 and uses Ghostscript 8.15. Downloading ImageMagick-6.7.1-0.x86_64.rpm for centos 5 from http://www.imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-6.7.1-1.x86_64.rpm , removing the current ImageMagick packages with yum, and installing the downloaded rpm will partially address the issue. It appears you also need to upgrade ghostscript as a minimum by using yum upgrade ghostscript which should bring you to a minimum of version 8.7.

      These steps will get thumbnail creation working but this version of Imagemagick will produce thumbs with a black background if the pdf is transparent. Adding a -alpha Off paramater to the convert syntax in our module function (plugins/ImageManipulation.inc – function createThumbnailFromPDF) will get the pdf transparency work properly for jpg pdf's.

      Tests run on Ubuntu which is running ImageMagick 6.6.2-6 and Ghostscript 9.01 work out of the box on the pdf's in question but also run fine with the additional -alpha Off parameter in the module convert command and suffer from no transparency issues in either configuration.

      I would be more comfortable with Ghostscript 9.01 running on CentOS as well but have not located a reliable package at this time and am reluctant to advise a compiled approach as a solution for what is already a tedious upgrade path for our stack. The upgrade path described here for CentOS is relatively simple and seems to resolve the issues albeit requiring a minor code change in a basic module function. Note that the issue the code modification addresses is one created by the version of ImageMagick which is a later release than Ubuntu's package may indicate that is a positive step to take in any case.

      Attached file(s) can be used to test as an example of a file that a) fails to build a thumbnail and (tnfails.pdf) b) fails on transparency without the -alpha Off switch (transfails.pdf) should you want to test output at various stages.

      To Do:
      1) It would be nice to upgrade Ghostscript on CentOS 5x to see how that impacts this from the code/module perspective although that is more work than the minor code fix
      2) We could also check on CentOS 6x to see if the IM and GS versions have caught up
      3) Move the -alpha Off switch in the convert functions in question in Imagemanipulation.inc pending approval at committers

      1) Do we apply to a) tagged relase v11.1 as well as master or do we apply at all
      2) This has prompted discussions re the TN dsid in terms of standard size and possibility of
      3) should the function in play here (createThumbnailFromPDF) be using conditionals there currently or just assume our base server stack (LINUX)


        1. compile_image_magik.txt
          0.8 kB
        2. tnfails.pdf
          330 kB
        3. transfails.pdf
          310 kB



            plux Peter Lux
            0 Vote for this issue
            0 Start watching this issue