gpt4 book ai didi

delegates - ImageMagick 不会将 Ghostscipt 显示为委托(delegate)

转载 作者:行者123 更新时间:2023-12-01 09:33:53 25 4
gpt4 key购买 nike

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

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

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

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

convert -list delegatePath: /usr/local/Cellar/imagemagick/6.7.7-6/etc/ImageMagick/delegates.xmlDelegate                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 视为委托(delegate)?

 

最佳答案

嗯,在来自 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....

关于delegates - ImageMagick 不会将 Ghostscipt 显示为委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11907029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com