ImageMagick: "convert not authorized" error

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
peter_b
Chatterbox
Posts: 383
Joined: Tue Nov 12, 2013 2:05 am

ImageMagick: "convert not authorized" error

Post by peter_b »

[PROBLEM]
Converting several PNGs into a PDF using Imagemagick, I get the following error:
convert: not authorized `output.pdf' @ error/constitute.c/WriteImage/1028
Although the command is valid, checked, correct and everything:

Code: Select all

$ convert *.png -resize 1920x1920 -compress jpeg -density 150 -units PixelsPerInch -quality 65% output.pdf
  • OS is Xubuntu 16.04.3
  • ImageMagick: 8:6.8.9.9-7ubuntu5.13

[SOLUTION]
I haven't checked if this approach is correct (lack of time right now), but here's a quick hack:

In "/etc/ImageMagick-6/policy.xml", replace rights "none" with "read|write" for PDF. Like this:

Code: Select all

  <!-- disable ghostscript format types -->
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="read|write" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <policy domain="coder" rights="none" pattern="XPS" />
I never had to deal with ImageMagick policies/rights before, so use this at your own risk...


Links:
https://stackoverflow.com/questions/429 ... dimage-453
Post Reply