我正在尝试在OSX Lion上安装Imagemagick,但有些东西没有按预期工作.
-> brew install imagemagick
/usr/local/git/bin/git
==> Cloning https://github.com/adamv/ImageMagick.git
Cloning into /Users/klebershimabuku/Library/Caches/Homebrew/imagemagick--git...
fatal: https://github.com/adamv/ImageMagick.git/info/refs not found: did you run git update-server-info on the server?
Error: Failure while executing: git clone --depth 1 https://github.com/adamv/ImageMagick.git /Users/kleber/Library/Caches/Homebrew/imagemagick--git
Run Code Online (Sandbox Code Playgroud)
布鲁医生说:
-> brew doctor
We couldn't detect gcc 4.0.x. Some formulae require this compiler.
Some "config" scripts were found in your path, but not in system or Homebrew folders.
`./configure` scripts often look for *-config scripts to determine if software packagesare installed, and what additional …Run Code Online (Sandbox Code Playgroud) Imagemagick安全策略似乎不允许我执行从pdf到png的转换.转换其他扩展似乎正在起作用,而不是来自pdf.我没有改变任何imagemagick设置,因为我安装它...我正在使用Arch Linux,如果操作系统很重要.
user@machine $ convert -density 300 -depth 8 -quality 90 input.pdf output.png
convert: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
convert: no images defined `output.png' @ error/convert.c/ConvertImageCommand/3288.
Run Code Online (Sandbox Code Playgroud) 我有一个程序,我需要使用Image Magick将PDF转换为图像.我这样做是使用subprocess包:
cmd = 'magick convert -density 300 '+pdfFile+'['+str(rangeTuple[0])+'-'+str(rangeTuple[1])+'] -depth 8 '+'temp.tiff' #WINDOWS
if(os.path.isfile('temp.tiff')):
os.remove('temp.tiff')
subprocess.call(cmd,shell=True)
im = Image.open('temp.tiff')
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
convert-im6.q16: not authorized `temp2.pdf' @ error/constitute.c/ReadImage/412.
convert-im6.q16: no images defined `temp.tiff' @ error/convert.c/ConvertImageCommand/3258.
Traceback (most recent call last):
File "UKExtraction2.py", line 855, in <module>
doItAllUpper("A0","UK5.csv","temp",59,70,"box",2,1000,firstPageCoordsUK,boxCoordUK,voterBoxCoordUK,internalBoxNumberCoordUK,externalBoxNumberCoordUK,addListInfoUK)
File "UKExtraction2.py", line 776, in doItAllUpper
doItAll(tempPDFName,outputCSV,2,pdfs,formatType,n_blocks,writeBlockSize,firstPageCoords,boxCoord,voterBoxCoord,internalBoxNumberCoord,externalBoxNumberCoord,addListInfo,pdfName)
File "UKExtraction2.py", line 617, in doItAll
mainProcess(pdfName,(0,noOfPages-1),formatType,n_blocks,outputCSV,writeBlockSize,firstPageCoords,boxCoord,voterBoxCoord,internalBoxNumberCoord,externalBoxNumberCoord,addListInfo,bigPDFName,basePages)
File "UKExtraction2.py", line 542, in mainProcess
im = Image.open('temp.tiff')
File "/home/rohit/.local/lib/python3.6/site-packages/PIL/Image.py", line 2609, in open
fp = builtins.open(filename, "rb") …Run Code Online (Sandbox Code Playgroud) imagemagick ×2
gcc ×1
gcc4 ×1
git ×1
homebrew ×1
linux ×1
osx-lion ×1
pdf ×1
python ×1
subprocess ×1