3

试图让 ImageMagick 在 OSX Lion 中使用 MacPorts 与 Ghostscript 交谈,但它没有。曾经在 Snow Leopard 下运行良好,但在迁移助手期间出现了问题。

无论如何,已经卸载了所有的 Mac 端口,现在正在尝试使用Homebrew

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

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

转换列表委托

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

委托命令
-------------------------------------------------- -----------------------------------------
    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 => "如果 [ -e hp2xx -o -e /usr/bin/hp2xx ]; 然后 hp2xx -q -m eps -f `basename "%o"` "%i"; mv -f `basename "%o "` "%o"; else echo "您需要安装 hp2xx 才能将 HPGL 文件与 ImageMagick 一起使用。"; exit 1; fi"
        htm => "html2ps" -U -o "%o" "%i"
       html => "html2ps" -U -o "%o" "%i"
      https => "卷曲" -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";"转换”-连接“%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 =>“扫描图像”>“%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$ 转换列表委托 | 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 => "如果 [ -e hp2xx -o -e /usr/bin/hp2xx ]; 然后 hp2xx -q -m eps -f `basename "%o"` "%i"; mv -f `basename "%o "` "%o"; else echo "您需要安装 hp2xx 才能将 HPGL 文件与 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"


转换列表配置

    路径:/usr/local/Cellar/imagemagick/6.7.7-6/lib/ImageMagick/config/configure.xml
    
    名称 值
    -------------------------------------------------- -----------------------------------------
    抄送 /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 '--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/
    版权所有 (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
    代表 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
    执行前缀 /usr/local/Cellar/imagemagick/6.7.7-6
    EXECUTABLE_PATH /usr/local/Cellar/imagemagick/6.7.7-6/bin
    特点 OpenCL
    FILTER_PATH /usr/local/Cellar/imagemagick/6.7.7-6/lib/ImageMagick/modules-Q16/filters
    主机 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/库 -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
    名称 ImageMagick
    PCFLAGS       
    前缀 /usr/local/Cellar/imagemagick/6.7.7-6
    量子深度 16
    发布日期 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 苹果
    版本 6.7.7
    网站 http://www.imagemagick.org

如何强制 Ghostscript 被 ImageMagick 视为代表?

 

4

3 回答 3

4

Well, in your listing coming from convert -list delegate there are the following six lines:

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"

They all do mention "gs"...

However, you say you first installed ImageMagick and only then Ghostscript.

So ImageMagick could not find any Ghostscript during compile time, that's why it doesn't appear in convert -list configure | grep DELEG....

You should try and install in reverse order: first Ghostscript, then ImageMagick....

于 2012-08-10T18:59:54.590 回答
3

tl;博士

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

brew update \
 && brew reinstall ghostscript \
 && brew reinstall imagemagick --with-ghostscript
于 2016-04-14T20:04:42.420 回答
1

您的系统上是否安装了多个 ImageMagick's convert(可能是因为您的 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)
于 2012-08-13T14:07:00.777 回答