Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageMagick的安全策略阻止了与临时文件@/tmp/tmpur5hyyto.txt相关的操作。 #92

Closed
chenhengzh opened this issue Mar 28, 2024 · 3 comments

Comments

@chenhengzh
Copy link
Contributor

记录一个已解决的问题。

报错:
OSError: MoviePy Error: creation of None failed because of the following error: convert-im6.q16: attempt to perform an operation not allowed by the security policy @/tmp/tmpur5hyyto.txt' @ error/property.c/InterpretImageProperties/3668. convert-im6.q16: no images defined PNG32:/tmp/tmpkq291k_5.png' @ error/convert.c/ConvertImageCommand/3258. . .This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary. Check the documentation.

分析:
这个错误通常与ImageMagick的安全策略有关,尤其是在处理文件时。ImageMagick是一个强大的工具,用于创建、编辑、合成或转换数字图像,它可以通过命令行使用。MoviePy在某些情况下依赖ImageMagick来处理图像或视频文件,特别是在转换图像格式时。错误信息提示ImageMagick的安全策略阻止了某些操作,特别是与临时文件@/tmp/tmpur5hyyto.txt相关的操作。

解决方案:
可以在ImageMagick的配置文件policy.xml中找到这些策略。这个文件通常位于/etc/ImageMagick-6/、/etc/ImageMagick/或ImageMagick安装目录的类似位置。修改包含pattern="@"的条目,将rights="none"更改为rights="read|write"以允许对文件的读写操作。

@harry0703
Copy link
Owner

感谢研究,已加入 readme 的FAQ

@ck1123456
Copy link

您好,我想问一下如何在linux进入policy.xml文件呢

@chesley666
Copy link

您好,我想问一下如何在linux进入policy.xml文件呢

我是linux mint22系统,magick配置文件在 /etc/ImageMagick-6/policy.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants