Wand Policy Error: error/constitute.c/ReadImage/412

后端 未结 3 1953
终归单人心
终归单人心 2020-12-09 16:36

I am facing the issue while converting pdf to image using Wand:

E           wand.exceptions.PolicyError: not authorized `/opt/sample.pdf\' @ error/constitute.         


        
相关标签:
3条回答
  • 2020-12-09 17:06

    This is probably due to an security fix of the underlaying package (see https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1796563)

    I fixed it for me by editing the /etc/ImageMagick-6/policy.xml and changed the rights for the pdf line to "read":

    <policy domain="coder" rights="read" pattern="PDF" />
    
    0 讨论(0)
  • 2020-12-09 17:07

    Editing the /etc/ImageMagick-6/policy.xml and changed the rights for the pdf line to "read|write":

    <policy domain="coder" rights="read|write" pattern="PDF" />
    

    and restarting the server in my case Jupiter Notebook runtime fixed my issue

    0 讨论(0)
  • 2020-12-09 17:22

    Troubleshooting ImageMagick on Debian-based systems.

    If encountered with a PolicyError, you may be able to fix it by changing the following line in /etc/ImageMagick-6/policy.xml from this:

    <policy domain="coder" rights="none" pattern="PDF" />
    

    to this:

    <policy domain="coder" rights="read|write" pattern="PDF" />
    

    (More details about policy.xml available here.)

    Taken from the repo

    0 讨论(0)
提交回复
热议问题