取代預設的 ImageMagick policy.xml 設定

安裝 ImageMagick 預設的 policy 設定檔案在 /etc/ImageMagick/policy.xml 路徑,如果想改變 policy 又沒有 root 權限,可以參考以下設定:

先查看預設的設定

$ identify -list policy
(omit)
Path: /etc/ImageMagick/policy.xml
(omit)

然後,自己建立想要的 policy.xml

$ mkdir -p ~/.config/ImageMagick
$ vi /.config/ImageMagick/policy.xml
<policymap>
<policy domain=”resource” name=”temporary-path” value=”/scratch” />
</policymap>

再設定一下環境變數就好了。

$ export MAGICK_CONFIGURE_PATH=~/.config/ImageMagick/

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.