ImageMagick不会将Ghostscipt显示为委托

时间:2012-08-10 18:09:26

标签: delegates osx-lion imagemagick ghostscript

试图让ImageMagick在OSX Lion中使用MacPorts与Ghostscript对话,但它没有它。曾经让它在Snow Leopard下工作正常,但在迁移助手期间出现了问题。

无论如何,已经取消了所有Mac端口的安装,我现在正在尝试使用Homebrew

安装了Homebrew,安装了ImageMagick,然后安装了ghostscript。 Imagemagick工作正常(使用php图像脚本和MAMP),但Ghostscript没有将PDF转换为jpgs。我可以看到,'gs'没有被列为Imagemagick的代表。

以下是一些相关的终端转储:

convert -list delegate

Path: /usr/local/Cellar/imagemagick/6.7.7-6/etc/ImageMagick/delegates.xml

Delegate                Command
-------------------------------------------------------------------------------
    blender =>          "blender" -b "%i" -F PNG -o "%o""\n"convert" -concatenate "%o*.png" "%o"
        cdr =>          "uniconvertor" "%i" "%o.svg"; mv "%o.svg" "%o"
        cgm =>          "ralcgm" -d ps -oC  "%o" 2> "%Z"
        dng:decode =>          "ufraw-batch" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i"
        dvi =>          "dvips" -q -o "%o" "%i"
        epsps        "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pswrite" "-sOutputFile=%o" "-f%i"
        epspdf       "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"
        fig =>          "fig2dev" -L ps "%i" "%o"
        hpg =>          "hp2xx" -q -m eps -f `basename "%o"` "%i";     mv -f `basename "%o"` "%o"
       hpgl =>          "if [ -e hp2xx -o -e /usr/bin/hp2xx ]; then     hp2xx -q -m eps -f `basename "%o"` "%i";     mv -f `basename "%o"` "%o";   else     echo "You need to install hp2xx to use HPGL files with ImageMagick.";     exit 1;   fi"
        htm =>          "html2ps" -U -o "%o" "%i"
       html =>          "html2ps" -U -o "%o" "%i"
      https =>          "curl" -s -k -o "%o" "https:%M"
       ilbm =>          "ilbmtoppm" "%i" > "%o"
        man =>          "groff" -man -Tps "%i" > "%o"
       miff          "ffmpeg" -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z"
        pdfeps       "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i"
        pdfps        "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pswrite" "-sOutputFile=%o" "-f%i"
        plt =>          "echo" "set size 1.25,0.62; set terminal postscript portrait color solid; set output \'%o\'; load \'%i\'" > "%u";"gnuplot" "%u"
        pnm "%o"
        pov =>          "povray" "+i%i" -D0 "+o%o" +fn%q +w%w +h%h +a -q9 "-kfi%s" "-kff%n";"convert" -concatenate "%o*.png" "%o"
         pseps       "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i"
         pspdf       "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"
       rgba          "scanimage" -d "%i" > "%o"
      scanx =>          "scanimage" > "%o"
      shtml =>          "html2ps" -U -o "%o" "%i"
        sid =>          "mrsidgeodecode" -if sid -i "%i" -of tif -o "%o" > "%u"
        svg =>          "rsvg-convert" -o "%o" "%i"
       tiffps        "enscript" -o "%o" "%i"
        wmf =>          "wmf2eps" -o "%o" "%i"
    doms-imac:~ dom$ convert -list delegate | grep --color -E '(eps|pdf)'
        epsps        "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pswrite" "-sOutputFile=%o" "-f%i"
        epspdf       "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"
        hpg =>          "hp2xx" -q -m eps -f `basename "%o"` "%i";     mv -f `basename "%o"` "%o"
       hpgl =>          "if [ -e hp2xx -o -e /usr/bin/hp2xx ]; then     hp2xx -q -m eps -f `basename "%o"` "%i";     mv -f `basename "%o"` "%o";   else     echo "You need to install hp2xx to use HPGL files with ImageMagick.";     exit 1;   fi"
        pdfeps       "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i"
        pdfps        "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pswrite" "-sOutputFile=%o" "-f%i"
         pseps       "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i"
         pspdf       "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"
        wmf =>          "wmf2eps" -o "%o" "%i"


convert -list configure

    Path: /usr/local/Cellar/imagemagick/6.7.7-6/lib/ImageMagick/config/configure.xml

    Name          Value
    -------------------------------------------------------------------------------
    CC            /usr/bin/clang
    CFLAGS        -D_THREAD_SAFE -D_THREAD_SAFE -pthread -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7 -Wall -D_THREAD_SAFE -pthread
    CODER_PATH    /usr/local/Cellar/imagemagick/6.7.7-6/lib/ImageMagick/modules-Q16/coders
    CONFIGURE     ./configure  '--disable-osx-universal-binary' '--without-perl' '--prefix=/usr/local/Cellar/imagemagick/6.7.7-6' '--disable-dependency-tracking' '--enable-shared' '--disable-static' '--with-modules' '--without-magick-plus-plus' 'CC=/usr/bin/clang' 'CFLAGS=-Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7' 'LDFLAGS=-L/usr/local/Cellar/gettext/0.18.1.1/lib -L/usr/local/lib -L/usr/X11/lib' 'CPPFLAGS=-I/usr/local/Cellar/gettext/0.18.1.1/include -isystem /usr/local/include -I/usr/X11/include' 'CXX=/usr/bin/clang++' 'CXXFLAGS=-Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7'
    CONFIGURE_PATH /usr/local/Cellar/imagemagick/6.7.7-6/etc/ImageMagick/
    COPYRIGHT     Copyright (C) 1999-2012 ImageMagick Studio LLC
    CPPFLAGS      -I/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick
    CXX           /usr/bin/clang++
    CXXFLAGS      -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7 -D_THREAD_SAFE -pthread
    DEFS          -DHAVE_CONFIG_H
    DELEGATES     bzlib fontconfig freetype jpeg jng jp2 lcms2 png tiff x11 xml zlib
    DISTCHECK_CONFIG_FLAGS 'CC=/usr/bin/clang' 'CFLAGS=-Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7' 'CPPFLAGS=-I/usr/local/Cellar/gettext/0.18.1.1/include -isystem /usr/local/include -I/usr/X11/include' 'CXX=/usr/bin/clang++' 'LDFLAGS=-L/usr/local/Cellar/gettext/0.18.1.1/lib -L/usr/local/lib -L/usr/X11/lib' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-wmf=no --with-perl=no
    DOCUMENTATION_PATH /usr/local/Cellar/imagemagick/6.7.7-6/share/doc/ImageMagick
    EXEC-PREFIX   /usr/local/Cellar/imagemagick/6.7.7-6
    EXECUTABLE_PATH /usr/local/Cellar/imagemagick/6.7.7-6/bin
    FEATURES      OpenCL 
    FILTER_PATH   /usr/local/Cellar/imagemagick/6.7.7-6/lib/ImageMagick/modules-Q16/filters
    HOST          x86_64-apple-darwin11.4.0
    INCLUDE_PATH  /usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick
    LDFLAGS       -L/usr/local/Cellar/imagemagick/6.7.7-6/lib -L/usr/local/Cellar/gettext/0.18.1.1/lib -L/usr/local/lib -L/usr/X11/lib -L/usr/X11/lib
    LIB_VERSION   0x677
    LIB_VERSION_NUMBER 6,7,7,6
    LIBRARY_PATH  /usr/local/Cellar/imagemagick/6.7.7-6/lib/ImageMagick
    LIBS          -lMagickCore -llcms2 -ltiff -lfreetype -ljpeg -L/usr/X11/lib -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -Wl,-framework,OpenCL -lm -lpthread -lltdl
    NAME          ImageMagick
    PCFLAGS       
    PREFIX        /usr/local/Cellar/imagemagick/6.7.7-6
    QuantumDepth  16
    RELEASE_DATE  2012-08-08
    SHARE_PATH    /usr/local/Cellar/imagemagick/6.7.7-6/share/ImageMagick
    SVN_REVISION  8165
    TARGET_CPU    x86_64
    TARGET_OS     darwin11.4.0
    TARGET_VENDOR apple
    VERSION       6.7.7
    WEBSITE       http://www.imagemagick.org

如何通过ImageMagick强制Ghostscript被视为委托?

3 个答案:

答案 0 :(得分:4)

嗯,在convert -list delegate的商家信息中,有以下六行:

eps<=>ps     "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pswrite" "-sOutputFile=%o" "-f%i"
eps<=>pdf    "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"
pdf<=>eps    "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i"
pdf<=>ps     "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pswrite" "-sOutputFile=%o" "-f%i"
 ps<=>eps    "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i"
 ps<=>pdf    "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"

他们都提及"gs" ...

但是,你说你首先安装了ImageMagick,只有然后 Ghostscript。

因此ImageMagick在编译期间找不到任何Ghostscript,这就是为什么它没有出现在convert -list configure | grep DELEG ....

你应该尝试以相反的顺序安装:第一个 Ghostscript,然后是ImageMagick ....

答案 1 :(得分:3)

<强> TL;博士

对于后来者,这是@Kurt Pfeifle的答案+评论部分的简短版本。跑吧

brew update \
 && brew reinstall ghostscript \
 && brew reinstall imagemagick --with-ghostscript

答案 2 :(得分:1)

您的系统上是否有多次ImageMagick转换安装(可能是因为您的MacPorts安装没有被彻底删除)?要找到答案,请运行此命令行(使用Spotlight搜索):

mdfind convert 2>&1 | grep convert

使用来自这些命令的完整信息更新您的问题:

which convert
convert -list configure
convert -version
otool -L $(which convert)
which gsx
which gsc
which gs
gs -version
otool -L $(which gs)