Imagemagick - change policy.xml on Heroku

微笑、不失礼 提交于 2019-12-06 13:26:40
Drarok

I’ve found a relatively simple solution.

Create a .magick directory in your app’s source, and add your policy.xml there. Then, you’ll have to set the environment variable MAGICK_CONFIGURE_PATH to /app/.magick in order to load your file with higher precedence than the default one.

We need to install the third party software ImageMagick on heroku. I used this https://github.com/ello/heroku-buildpack-imagemagick build pack for installing ImageMagick.

So, inside bin/compile, there is a policy file, which is restricting the images to read over Https, enable the attribute rights to read which allows to read over Https

Fork the repo and do your changes, commit and add that repository url to your heroku buildpacks

Read the warnings at ImageTragick, then make a backup and delete the line that restricts you.

You can find the file to edit in the same directory as the other XML config files by doing the following - the file is called policy.xml:

convert -debug configure -list font 2>&1 | grep -E "Searching|Loading"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!