How can I override ImageMagick settings in a policy.xml file?

Issue

I want to set custom values for ImageMagick parameters via a policy.xml file but my changes aren't being recognized.

Resolution

ImageMagick is unusual in that the global policy files override the local ones by default. The load order for policy files is described here: https://imagemagick.org/script/resources.php

The solution in this case is to ensure that any custom policy files appear first in the MAGICK_CONFIGURE_PATH. For example, creating a file in the root of your app at .magick/policy.xml you can set the following:

heroku config:set MAGICK_CONFIGURE_PATH="/app/.magick/:/etc/ImageMagick-6/"

This should ensure that your custom file takes precedent over the global config file.

You can verify which settings are being loaded by using the following command:

identify -list policy

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support