convert:not authorized `aaaa` @ error/constitute.c/ReadImage/453

后端 未结 11 2422
无人及你
无人及你 2020-11-27 08:50

I want to create a captcha pic by use convert from ImageMagick.

And I follow this, but there are some problem .

Input In my linux shell:

11条回答
  •  孤城傲影
    2020-11-27 09:40

    Note: the solution in this and other answers involves disabling safety measures that are there to fix arbitrary code execution vulnerabilities. See for instance this ghostscript-related and this ubuntu-related announcement. Only go forward with these solutions if the input to convert comes from a trusted source.

    I use ImageMagick in php (v.7.1) to slice PDF file to images.

    First I got errors like:

    Exception type: ImagickException

    Exception message: not authorized ..... @ error/constitute.c/ReadImage/412

    After some changes in /etc/ImageMagick-6/policy.xml I start getting erroes like:

    Exception type: ImagickException

    Exception message: unable to create temporary file ..... Permission denied @ error/pdf.c/ReadPDFImage/465

    My fix:

    In file /etc/ImageMagick-6/policy.xml (or /etc/ImageMagick/policy.xml)

    1. comment line

      
      
    2. change line

      
      

      to

      
      
    3. add line

      
      

    Then restart your web server (nginx, apache).

提交回复
热议问题