In ImageMagick, is there any way to control policy locally? Something like ~/.imagemagick/policy.xml.


$ dpkg -l imagemagick
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
ii  imagemagick    8: amd64        image manipulation programs -- bi

$ convert --version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-09-28 http://www.imagemagick.org

ImageMagick v6 & v7 looks for all files in ~/.config/ImageMagick/ in addition to /etc.

This includes policy.xml, although I'm not sure what order the policy directives are processed in.

(ImageMagick v6 also used ~/.magick/, but this is an obsolete location removed from v7.)

To determine what files a program might be looking for, you can use strace:

strace -e file display test.png |& grep policy.xml
  • Is there any option for v8? that's the one I'm currently using (8:, but placing policy.xml in that folder doesn't seem to work. – nightcod3r Oct 23 '18 at 14:35
  • ImageMagick v8 does not exist as far as I could determine. Even the latest Git master calls itself "version 7.0.8". – grawity Oct 23 '18 at 14:38
  • Please, see update in the question. – nightcod3r Oct 23 '18 at 15:32
  • That's not v8. That's v6.8.9, Debian package 'epoch' #8. – grawity Oct 23 '18 at 15:50
  • According to this post, the only way to use the local policy configuration is to rebuild ImageMagick... imagemagick.org/discourse-server/viewtopic.php?t=29618 , or, to be more precise, you can only control what is not disabled globally: stackoverflow.com/a/52719789/4179803 – nightcod3r Oct 23 '18 at 16:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.