我在尝试使用ghostscript-9.10安装ImageMagick-6.8.6-9时遇到了问题。
我安装了带有前缀“./configure --prefix = / usr / local /”的ghostscript并测试了“gs”并返回
"GPL Ghostscript 9.10 (2013-08-30)
Copyright (C) 2013 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 9.10: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting."
当我尝试安装ImageMagick时,我输入命令:
LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib, /usr/local/share/ghostscript/9.10/lib"
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/share/ghostscript/9.10/lib
./configure --prefix=/usr/local --with-gslib --with-gs-font-dir=/usr/share/fonts/type1/gsfonts/ --with-perl-optons=PREFIX=/usr/local/php53
返回:
ImageMagick配置如下。请验证此配置 符合你的期望。
Host system type: x86_64-unknown-linux-gnu
Build system type: x86_64-unknown-linux-gnu
Option Value
-------------------------------------------------------------------------------
Shared libraries --enable-shared=yes yes
Static libraries --enable-static=yes yes
Module support --with-modules=no no
GNU ld --with-gnu-ld=yes yes
Quantum depth --with-quantum-depth=16 16
High Dynamic Range Imagery
--enable-hdri=no no
Delegate Configuration:
BZLIB --with-bzlib=yes yes
Autotrace --with-autotrace=no no
Dejavu fonts --with-dejavu-font-dir=default none
DJVU --with-djvu=yes yes
DPS --with-dps=yes no
FFTW --with-fftw=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=yes yes
FreeType --with-freetype=yes yes
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gs (9.10)
Ghostscript fonts --with-gs-font-dir=/usr/share/fonts/type1/gsfonts/ /usr/share/fonts/type1/gsfonts//
Ghostscript lib --with-gslib=yes no
Graphviz --with-gvc=no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes yes
JPEG-2000 --with-jp2=yes yes
LCMS v1 --with-lcms=yes yes
LCMS v2 --with-lcms2=yes no
LQR --with-lqr=yes yes
LTDL --with-ltdl=yes no
LZMA --with-lzma=yes no
Magick++ --with-magick-plus-plus=yes yes
MUPDF --with-mupdf=no no
OpenEXR --with-openexr=yes yes
PANGO --with-pango=yes yes
PERL --with-perl=no no
PNG --with-png=yes yes
RSVG --with-rsvg=no no
TIFF --with-tiff=yes yes
WEBP --with-webp=yes no
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=no no
X11 --with-x= yes
XML --with-xml=yes yes
ZLIB --with-zlib=yes yes
X11 Configuration:
X_CFLAGS =
X_PRE_LIBS = -lSM -lICE
X_LIBS =
X_EXTRA_LIBS =
Options used to compile and link:
PREFIX = /usr/local
EXEC-PREFIX = /usr/local
VERSION = 6.8.6
CC = gcc -std=gnu99 -std=gnu99
CFLAGS = -pthread -I/usr/include/OpenEXR -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -fopenmp -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CPPFLAGS = -I/usr/local/include/ImageMagick-6
PCFLAGS = -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
DEFS = -DHAVE_CONFIG_H
LDFLAGS =
MAGICK_LDFLAGS = -L/usr/local/lib
LIBS = -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -llqr-1 -lglib-2.0 -lpng12 -ldjvulibre -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -pthread -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lxml2 -lz -lm -lgomp
CXX = g++
CXXFLAGS = -g -O2 -pthread
FEATURES = DPC OpenMP
DELEGATES = bzlib djvu mpeg fontconfig freetype jng jp2 jpeg lcms lqr openexr pango png ps tiff x xml zlib
Then I'll type "make" and "sudo make install."
After the installation, I've gathered some information:
$ convert --version
Version: ImageMagick 6.8.6-9 2013-09-19 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib djvu fontconfig freetype jng jp2 jpeg lcms lqr openexr pango pangocairo png png tiff x xml zlib
$ convert -list configure
Path: /usr/local/lib/ImageMagick-6.8.6//config-Q16/configure.xml
Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -pthread -I/usr/include/OpenEXR -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -fopenmp -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CODER_PATH /usr/local/lib/ImageMagick-6.8.6/modules-Q16/coders
CONFIGURE ./configure '--prefix=/usr/local' '--with-gslib' '--with-gs-font-dir=/usr/share/fonts/type1/gsfonts/' '--with-perl-optons=PREFIX=/usr/local/php53'
CONFIGURE_PATH /usr/local/etc/ImageMagick-6/
COPYRIGHT Copyright (C) 1999-2013 ImageMagick Studio LLC
CPPFLAGS -I/usr/local/include/ImageMagick-6
CXX g++
CXXFLAGS -g -O2 -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib djvu mpeg fontconfig freetype jng jp2 jpeg lcms lqr openexr pango png ps tiff x xml zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fontpath= --with-gs-font-dir=/usr/share/fonts/type1/gsfonts/ --with-gvc=no --with-mupdf=no --with-rsvg=no --with-wmf=no --with-perl=no
DOCUMENTATION_PATH /usr/local/share/doc/ImageMagick-6
EXEC-PREFIX /usr/local
EXECUTABLE_PATH /usr/local/bin
FEATURES DPC OpenMP
FILTER_PATH /usr/local/lib/ImageMagick-6.8.6/modules-Q16/filters
HOST x86_64-unknown-linux-gnu
INCLUDE_PATH /usr/local/include/ImageMagick-6
LDFLAGS -L/usr/local/lib
LIB_VERSION 0x686
LIB_VERSION_NUMBER 6,8,6,9
LIBRARY_PATH /usr/local/lib/ImageMagick-6.8.6
LIBS -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -llqr-1 -lglib-2.0 -lpng12 -ldjvulibre -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -pthread -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lxml2 -lz -lm -lgomp
NAME ImageMagick
PCFLAGS -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
PREFIX /usr/local
QuantumDepth 16
RELEASE_DATE 2013-09-19
SHARE_PATH /usr/local/share/ImageMagick-6
SHAREARCH_PATH /usr/local/lib/ImageMagick-6.8.6/config-Q16
SVN_REVISION 13089
TARGET_CPU x86_64
TARGET_OS linux-gnu
TARGET_VENDOR unknown
VERSION 6.8.6
WEBSITE http://www.imagemagick.org
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
FEATURES OpenMP
NAME ImageMagick
QuantumDepth 16
$ convert -list delegate
Path: /usr/local/etc/ImageMagick-6/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 < "%i" > "%o" 2> "%Z"
dng:decode => "ufraw-batch" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i"
dot => "dot" -Tsvg "%i" -o "%o"
dvi => "dvips" -q -o "%o" "%i"
eps<=>pdf "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"
eps<=>ps "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=nodevice" "-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 => "hp2xx" -q -m eps -f `basename "%o"` "%i"; mv -f `basename "%o"` "%o"
htm => "html2ps" -U -o "%o" "%i"
html => "html2ps" -U -o "%o" "%i"
https => "curl" -s -k -o "%o" "https:%M"
ilbm => "ilbmtoppm" "%i" > "%o"
jxr => "mv "%i" "%i.jxr"; "JxrDecApp" -i "%i.jxr" -o "%o.pnm"; mv "%i.jxr" "%i"; mv "%o.pnm" "%o"
man => "groff" -man -Tps "%i" > "%o"
miff<= show "display" -delay 0 -window-group %[group] -title "%l " "ephemeral:%i"
mpeg:decode => "ffmpeg" -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z"
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=nodevice" "-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"
png<= webp "cwebp" -quiet -q %Q "%i" -o "%o"
pnm<= ilbm "ppmtoilbm" -24if "%i" > "%o"
pnm<= jxr "mv "%i" "%i.pnm"; "" -i "%i.pnm" -o "%o.jxr"; mv "%i.pnm" "%i"; mv "%o.jxr" "%o"
pnm<= wdp "mv "%i" "%i.pnm"; "" -i "%i.pnm" -o "%o.jxr"; mv "%i.pnm" "%i"; mv "%o.jxr" "%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"
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"
ps<= print "lpr "%i"
rgba<= rle "rawtorle" -o "%o" -v "%i"
scan => "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"
tiff<= launch "gimp" "%i"
txt<=>ps "enscript" -o "%o" "%i"
wdp => "mv "%i" "%i.jxr"; "JxrDecApp" -i "%i.jxr" -o "%o.pnm"; mv "%i.jxr" "%i"; mv "%o.pnm" "%o"
webp => "dwebp" -pam "%i" -o "%o"
当我跑步时:
$ convert test.pdf test.jpg
convert: Postscript delegate failed `test.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/682.
convert: no images defined `test.jpg' @ error/convert.c/ConvertImageCommand/3127.
我先安装了ghostscript然后再安装了ImageMagick。无法弄清楚问题是什么,因为在./configure中它确实拿起那个ghostscript版本
"Ghostscript None gs (9.10)"
but "Ghostscript lib --with-gslib=yes no"
我也没有在delegate.xml中注意到它。
如何解决此问题或更新委托以使ghostscript占用?我试过多次重建/重新安装。
这是在dreamhost
上托管的Linux 64位计算机上---------------------- UPDATE ------------------------ ------------------- 所以问题实际上是pdf和ghostscript的类型。潜在的问题不在于ImageMagick,而在于ghostscript本身。
它必须处理特定的pdf文件。当我与他人一起测试时,它可以工作。我需要找一个没有私人信息的文件(pdf),以便我可以发布。
以下是错误:
执行此命令
$ "gs" -dDEBUG -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=peachjar.jpg"`
START 0 1539248 242651 1301992 20148 true 543 3 <0>
END PROCS 0 1559432 270087 1322176 26044 true 665 3 <0>
gs_std_e.ps 0 1588032 292042 1322176 28524 true 673 3 <0>
gs_il1_e.ps 0 1608216 300680 1322176 28524 true 674 3 <0>
END FONTDIR/ENCS 0 1608216 300908 1322176 28524 true 676 3 <0>
END DEVS 0 1652560 350323 1322176 28524 true 680 3 <0>
END STATD 10 1652560 357399 1322176 31404 true 685 3 <0>
END GS_FONTS 10 1702864 405991 1322176 31404 true 733 3 <0>
END BASIC COLOR 20 1702864 412637 1322176 31404 true 753 3 <0>
END IMAGE 20 1743232 430628 1322176 31404 true 758 3 <0>
gs_btokn.ps 20 1743232 437016 1322176 31404 true 762 3 <0>
gs_dps1.ps 20 1743232 440716 1322176 31404 true 764 3 <0>
gs_dps2.ps 20 1743232 445465 1322176 31404 true 765 3 <0>
gs_type1.ps 20 1763416 453120 1322176 31404 true 773 3 <0>
gs_lev2.ps 20 1792016 488997 1418792 128740 true 779 3 <0>
BEGIN RESOURCES 20 1792016 491563 1418792 128740 true 779 4 <1>
END CATEGORY 20 1792016 494182 1418792 129028 true 780 5 <1>
END GENERIC 20 1801952 511799 1418792 129028 true 782 4 <1>
END FIXED 20 1822136 525178 1418792 129028 true 782 4 <1>
END MISC 20 1842320 536448 1418792 129028 true 782 4 <1>
END ENCODING 20 1842320 539678 1418792 129028 true 782 4 <1>
gs_resmp.ps 30 1862504 560012 1418792 129028 true 786 3 <1>
gs_res.ps 30 1862504 557912 1418792 129028 true 786 3 <0>
gs_typ42.ps 30 1862504 559024 1418792 129028 true 789 3 <0>
gs_cidfn.ps 30 1882688 580725 1418792 129028 true 797 3 <0>
gs_cidcm.ps 30 1902872 603726 1418792 129028 true 797 3 <0>
gs_fntem.ps 30 1971840 659861 1418792 129236 true 799 3 <0>
gs_cidtt.ps 30 1992024 676379 1418792 129236 true 799 3 <0>
gs_cidfm.ps 30 1992024 679831 1418792 129236 true 799 3 <0>
gs_cmap.ps 30 1992024 690035 1418792 129236 true 804 3 <0>
gs_setpd.ps 30 2012208 708143 1418792 129236 true 804 3 <0>
gs_typ32.ps 30 2012208 710172 1418792 129236 true 802 3 <0>
gs_frsd.ps 30 2040808 727746 1418792 129236 true 802 3 <0>
gs_ll3.ps 30 2081176 758534 1418792 129236 true 803 3 <0>
gs_mex_e.ps 30 2081176 761224 1418792 129236 true 803 3 <0>
gs_mro_e.ps 30 2081176 762319 1418792 129236 true 803 3 <0>
gs_pdf_e.ps 40 2081176 763418 1418792 129236 true 803 3 <0>
gs_wan_e.ps 40 2081176 764494 1418792 129236 true 803 3 <0>
pdf_ops.ps 40 2101360 787780 1418792 129236 true 803 3 <0>
gs_l2img.ps 40 2101360 790762 1418792 129236 true 806 3 <0>
pdf_rbld.ps 40 2101360 795591 1418792 129236 true 818 3 <0>
pdf_base.ps 40 2141728 825841 1418792 129236 true 1015 4 <0>
pdf_draw.ps 40 2230880 900681 1418792 129236 true 1015 4 <0>
pdf_font.ps 50 2251064 936749 1418792 129956 true 1016 4 <0>
pdf_main.ps 50 2336928 1014744 1418792 129956 true 1023 4 <0>
pdf_sec.ps 50 2336928 1024953 1418792 129956 true 1023 4 <0>
gs_css_e.ps 50 2357112 1029974 1418792 129956 true 1023 4 <0>
gs_cff.ps 50 2430504 1098514 1418792 129956 true 1025 4 <0>
gs_mgl_e.ps 50 2430504 1100126 1418792 129956 true 1025 4 <0>
gs_agl.ps 50 2869632 1512857 1418792 129956 true 1026 4 <0>
Extend MacRomanEncodingForTrueType for TrueType: insert /product @ 184
Extend MacRomanEncodingForTrueType for TrueType: insert /Delta @ 198
Extend MacRomanEncodingForTrueType for TrueType: insert /greaterequal @ 179
Extend MacRomanEncodingForTrueType for TrueType: insert /lessequal @ 178
Extend MacRomanEncodingForTrueType for TrueType: insert /integral @ 186
Extend MacRomanEncodingForTrueType for TrueType: cannot insert /Euro @ 219 used for /currency
Extend MacRomanEncodingForTrueType for TrueType: insert /infinity @ 176
Extend MacRomanEncodingForTrueType for TrueType: insert /notequal @ 173
Extend MacRomanEncodingForTrueType for TrueType: insert /summation @ 183
Extend MacRomanEncodingForTrueType for TrueType: insert /apple @ 240
Extend MacRomanEncodingForTrueType for TrueType: insert /approxequal @ 197
Extend MacRomanEncodingForTrueType for TrueType: insert /lozenge @ 215
Extend MacRomanEncodingForTrueType for TrueType: insert /radical @ 195
Extend MacRomanEncodingForTrueType for TrueType: insert /Omega @ 189
Extend MacRomanEncodingForTrueType for TrueType: insert /pi @ 185
Extend MacRomanEncodingForTrueType for TrueType: insert /partialdiff @ 182
gs_ttf.ps 60 2983888 1641027 1418792 129956 true 1061 4 <0>
gs_icc.ps 60 3004072 1647206 1418792 129956 true 1062 4 <0>
gs_dps.ps 60 3012488 1662879 1418792 130450 true 1075 4 <0>
gs_dpnxt.ps 60 3012488 1664433 1418792 130450 true 1092 4 <0>
gs_epsf.ps 60 3012488 1670674 1418792 130450 true 1104 4 <0>
gs_fapi.ps 60 3012488 1673807 1418792 130450 true 1104 4 <0>
gs_pdfwr.ps 60 3052856 1711072 1418792 134080 true 1136 4 <0>
END INITFILES 60 3073040 1721109 1418792 134080 true 1164 4 <0>
/usr/share/ghostscript/8.71/Resource/Init/Fontmap 60 3073040 1724450 1418792 135918 true 1165 4 <1>
/usr/share/ghostscript/8.71/lib/Fontmap 60 3133592 1769567 1418792 135918 true 1165 4 <1>
/usr/share/ghostscript/8.71/Resource/Font/Fontmap 60 3133592 1769616 1418792 135918 true 1165 4 <1>
/usr/share/ghostscript/fonts/Fontmap 60 3133592 1769652 1418792 135918 true 1165 4 <1>
/var/lib/ghostscript/fonts/Fontmap 60 3133592 1769686 1418792 135918 true 1165 4 <1>
/usr/share/cups/fonts/Fontmap 70 3173960 1797151 1418792 135918 true 1165 4 <1>
/usr/share/ghostscript/fonts/Fontmap 70 3173960 1797187 1418792 135918 true 1165 4 <1>
/usr/local/lib/ghostscript/fonts/Fontmap 70 3173960 1797227 1418792 135918 true 1165 4 <1>
/usr/share/fonts/Fontmap 70 3173960 1797251 1418792 135918 true 1165 4 <1>
END FONTS 70 3173960 1797324 1418792 135918 true 1165 4 <0>
END DEVICE 70 3759296 2383796 1416984 134110 true 1169 4 <0>
END CONFIG 70 3759296 2384062 1416984 134110 true 1169 4 <0>
Checking.
-dict-
-dict-
-mark-
-dict-
true
Merging.
-dict-
-dict-
-mark-
-dict-
true
Selecting.
-dict-
-dict-
-dict-
-mark-
-dict-
true
Constructing.
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
Putting.
[612.0 792.0]
/.MediaSize
0
/%MediaSource
0
/%MediaDestination
true
/.LockSafetyParams
-mark-
true
-dict-
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
Result of putting.
false
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
Installing.
false
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
Finishing.
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
END INIT 80 3819848 2443760 10414560 9129632 true 1179 4 <0>
END GLOBAL 90 3819848 2446400 10414560 9130362 false 1176 4 <0>
END GC 100 3870096 1921230 10434744 9133278 false 1161 3 <0>
从我收集的内容来看,我首先想到的是因为我遗漏了ghostscript依赖的一些字体进行转换。
Extend MacRomanEncodingForTrueType for TrueType: cannot insert /Euro @ 219 used for `/currency`
谢谢, d
答案 0 :(得分:1)
Ghostscript错误似乎是因为你没有X可用,而显示设备使用X.至于ImageMagick的问题,我恐怕无法提供帮助。但是对我来说看起来不像Ghostscript问题。