0

I recently setup a new Macbook with 10.9.4 installed. But since that, I cannot use an script to convert PDF files to PNG anymore. It seems like my ImageMagick installation cannot find Ghostscript. I tried to install both several times(using .pkg installers), but nothing changed anything.

Here is my convert command:

convert -density 144x144 -quality 90 file.pdf file.png

And all I am getting is this:

Unrecoverable error: rangecheck in .putdeviceprops sfopen: gs_parse_file_name failed. ./base/gsicc_manage.c:866: gsicc_open_search(): Could not find lab.icc | ./psi/zusparam.c:856: set_lab_icc(): cannot find default lab icc profile convert: Postscript delegate failed 'file.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/665. convert: missing an image filename 'file.png' @ error/convert.c/ConvertImageCommand/3016.

It kinda says that it has problems with my pdf delegates. So, when I look at the delegates of my ImageMagick installation, it says so as well(convert -list configure):

Path: /opt/local/lib/ImageMagick-6.7.4/config/configure.xml
Name Value
-------------------------------------------------------------------------------
CC            /Developer/usr/bin/clang
CFLAGS        -pipe -O2 -arch x86_64 -Wall -D_THREAD_SAFE -pthread
CODER_PATH    /opt/local/lib/ImageMagick-6.7.4/modules-Q16/coders
CONFIGURE     ./configure  '--prefix=/opt/local' '--enable-shared' '--enable-static' '--disable-    ltdl-install' '--with-frozenpaths' '--without-openexr' '--disable-hdri' '--with-dps' '--with-bzlib' '--with-fontconfig' '--with-gslib' '--with-jpeg' '--with-lcms' '--with-png' '--with-tiff' '--with-zlib' '--with-modules' '--with-xml' '--with-x' '--without-perl' '--without-fpx' '--without-jbig' '--without-jp2' '--without-wmf' '--without-gvc' '--without-rsvg' '--without-lqr' '--with-gs-font-dir=/opt/local/share/fonts/urw-fonts' '--with-quantum-depth=16' 'CC=/Developer/usr/bin/clang' 'CFLAGS=-pipe -O2 -arch x86_64' 'LDFLAGS=-L/opt/local/lib -arch x86_64' 'CPPFLAGS=-I/opt/local/include' 'CXX=/Developer/usr/bin/clang++' 'CXXFLAGS=-pipe -O2 -arch x86_64'
CONFIGURE_PATH /opt/local/etc/ImageMagick/
COPYRIGHT     Copyright (C) 1999-2011 ImageMagick Studio LLC
CPPFLAGS      -I/opt/local/include/ImageMagick
CXX           /Developer/usr/bin/clang++
CXXFLAGS      -pipe -O2 -arch x86_64 -D_THREAD_SAFE -pthread
DEFS          -DHAVE_CONFIG_H
DELEGATES     bzlib fontconfig freetype gs jpeg jng lcms2 lzma png tiff x11 xml zlib
DISTCHECK_CONFIG_FLAGS 'CC=/Developer/usr/bin/clang' 'CFLAGS=-pipe -O2 -arch x86_64' 'CPPFLAGS=-I/opt/local/include' 'CXX=/Developer/usr/bin/clang++' 'LDFLAGS=-L/opt/local/lib -arch x86_64' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fpx=no --with-fontpath= --with-gs-font-dir=/opt/local/share/fonts/urw-fonts --with-gvc=no --with-jp2=no --with-lqr=no --with-openexr=no --with-rsvg=no --with-wmf=no --with-perl=no
DOCUMENTATION_PATH /opt/local/share/doc/ImageMagick/
EXEC-PREFIX   /opt/local
EXECUTABLE_PATH /opt/local/bin
FEATURES      
FILTER_PATH   /opt/local/lib/ImageMagick-6.7.4/modules-Q16/filters
HOST          x86_64-apple-darwin11.2.0
INCLUDE_PATH  /opt/local/include/ImageMagick
LDFLAGS       -L/opt/local/lib -L/opt/local/lib -arch x86_64 -L/opt/local/lib -L/opt/local/lib
LIB_VERSION   0x674
LIB_VERSION_NUMBER 6,7,4,0
LIBRARY_PATH  /opt/local/lib/ImageMagick-6.7.4
LIBS          -lMagickCore -llcms2 -ltiff -lfreetype -ljpeg -L/opt/local/lib -lfontconfig -lXext -lSM -lICE -lX11 -lXt -L/opt/local/lib -llzma -lbz2 -lz -lm -lgomp -lpthread -lltdl
NAME          ImageMagick
PCFLAGS       
PREFIX        /opt/local
QuantumDepth  16
RELEASE_DATE  2012-01-09
SHARE_PATH    /opt/local/share/ImageMagick-6.7.4
SVN_REVISION  6163
TARGET_CPU    x86_64
TARGET_OS     darwin11.2.0
TARGET_VENDOR apple
VERSION       6.7.4
WEBSITE       http://www.imagemagick.org

Path: [built-in]

Name          Value`
-------------------------------------------------------------------------------
NAME          ImageMagick

So, I guess the delegate line is the interesting one:

bzlib fontconfig freetype gs jpeg jng lcms2 lzma png tiff x11 xml zlib

No PDF there, but how can I add it? In case you think I don't have ghostscript installed(as many hints via google suggested), here is my ghostscript installation:

GPL Ghostscript 9.04 (2011-08-05) Copyright (C) 2011 Artifex Software, Inc. All rights reserved.

So, what is wrong here? Is "just" the PDF delegate missing? But how do I add it then? Is GS maybe configured wrong? What can I do to fix it? Any suggestion would be highly appreciated - I am completely out of ideas!

Many thanks in advance!

christopher
  • 520
  • 3
  • 10

1 Answers1

0

ImageMagick is finding Ghostscript because this:

sfopen: gs_parse_file_name failed.
./base/gsicc_manage.c:866: gsicc_open_search(): Could not find lab.icc
./psi/zusparam.c:856: set_lab_icc(): cannot find default lab icc profile 

Is a bunch of error messages from Ghostscript. The first thing to do is try running Ghostscript itself from the command line rather than from inside ImageMagick. Obviously you've tried running GS itself (from your post), but have you tried it with the relevant input file ? Eg:

./gs -sDEVICE=png16m -o out.png file.pdf

If that works, then its something specific to the command line which ImageMagick is passing to Ghostscript and you're going to have to ask someone who knows about ImageMagick how to determine that. I've found one site which claims that ImageMagick converts twice, first from PDF to PostScript then form PostScript to PNG. so you may need to determine if this is true and if so which step is causing a problem.

You might also consider trying the latest release, 9.15, of Ghostscript, the version you are using is (clearly) 3 years old.

KenS
  • 30,202
  • 3
  • 34
  • 51