harry0703 / MoneyPrinterTurbo

利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

chenhengzh opened this issue · comments

记录一个已解决的问题。

报错:
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"以允许对文件的读写操作。

感谢研究,已加入 readme 的FAQ

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