转换:未经授权的``aaaa''@ error/constitute.c/ReadImage/453 [英] convert:not authorized `aaaa` @ error/constitute.c/ReadImage/453

查看:134
本文介绍了转换:未经授权的``aaaa''@ error/constitute.c/ReadImage/453的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用ImageMagick的convert创建一个验证码图片.

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

我遵循但是有一些问题.

And I follow this, but there are some problem .

在我的Linux shell中输入:

Input In my linux shell:

convert -background white -fill black -font FreeSerif-Bold -pointsize 36 label:'adfgh' ./test.png

错误是:

转换:未经授权adfgh @ error/constitute.c/ReadImage/453. 转换:缺少图像文件名./test.png @ 错误/convert.c/ConvertImageCommand/3015

convert:not authorized adfgh @ error/constitute.c/ReadImage/453. convert:missing an image filename ./test.png @ error/convert.c/ConvertImageCommand/3015

我的ImageMagick:版本:6.7.2-7,我使用yum install ImageMagick进行安装.

My ImageMagick: Version:6.7.2-7 , I install it with yum install ImageMagick .

我一无所知.有什么建议吗?

I'm clueless. Any advice please?

推荐答案

注意:此答案和其他答案中的解决方案都涉及禁用安全措施,以解决任意代码执行漏洞.例如,请参见与ghostscript相关的

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.

我在php(v.7.1)中使用ImageMagick将PDF文件切片为图像.

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

首先,我出现类似以下错误:

First I got errors like:

异常类型:ImagickException

Exception type: ImagickException

异常消息:未经授权..... @ error/constitute.c/ReadImage/412

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

/etc/ImageMagick-6/policy.xml中进行了一些更改之后,我开始出现以下错误:

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

异常类型:ImagickException

Exception type: ImagickException

异常消息:无法创建临时文件.....权限被拒绝@ error/pdf.c/ReadPDFImage/465

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

我的修正:

在文件/etc/ImageMagick-6/policy.xml(或/etc/ImageMagick/policy.xml)中

  1. 评论行

  1. comment line

<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->

  • 换行

  • change line

    <policy domain="coder" rights="none" pattern="PDF" />
    

    <policy domain="coder" rights="read|write" pattern="PDF" />
    

  • 添加行

  • add line

    <policy domain="coder" rights="read|write" pattern="LABEL" />
    

  • 然后重新启动您的Web服务器(nginx,apache).

    Then restart your web server (nginx, apache).

    这篇关于转换:未经授权的``aaaa''@ error/constitute.c/ReadImage/453的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆