相关疑难解决方法(0)

如何使用自制软件安装imagemagick?

我正在尝试在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)

git homebrew gcc gcc4 osx-lion

191
推荐指数
4
解决办法
22万
查看次数

ImageMagick安全策略'PDF'阻止转换

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)

pdf imagemagick imagemagick-convert

107
推荐指数
12
解决办法
3万
查看次数

ImageMagick无权将PDF转换为图像

我有一个程序,我需要使用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)

python linux subprocess imagemagick

31
推荐指数
3
解决办法
1万
查看次数