2012-08-10 42 views
3

正試圖讓ImageMagick在OSX Lion中使用MacPorts與Ghostscript對話,但它沒有它。在Snow Leopard下用它來工作正常,但在遷移助理期間出現問題。ImageMagick不會顯示Ghostscipt作爲代理

總之,已經解除停止所有MAC端口的,我現在使用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 

如何強制Ghostscript的被看作是ImageMagick的委託?

回答

3

那麼,在你的清單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的.. ..

+0

這聽起來像一個非常簡單的解決方案。不幸的是它沒有奏效。我試過如下: 沖泡刪除的ghostscript 沖泡刪除ImageMagick的 釀造安裝ghostscript的 釀造安裝ImageMagick的 我甚至又試圖「釀造安裝ImageMagick的--with-GSLIB」最後一步,但我還是落得「轉換列表配置'顯示配置'--without-gslib'。我可以通過添加一個條目到delegates.xml文件手動將IM鏈接到GS,如果是的話,我應該添加什麼? – Dozza 2012-08-13 10:56:55

+2

檢查你的'./configure [你的選項]'命令是否有矛盾的參數:哪裏有'--with-gslib'和'--without-gslib'?你可以通過運行head -n 12 config來檢查。日誌「,它應該顯示你運行的./configure命令行。 – 2012-08-13 13:58:57

1

您的系統中是否安裝了多個ImageMagick轉換器(可能是因爲您的MacPorts安裝沒有完全刪除)?爲了找到答案,運行此命令行(使用Spotlight搜索):

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

TL;博士

爲:

mdfind convert 2>&1 | grep convert 

更新的充分信息,從這些命令來你的問題後來者,這是@ Kurt Pfeifle的答案+評論部分的簡短版本。剛跑

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