Each time I want to convert jpg file to pdf by this command

convert *.jpg pictures.pdf

I have this error message:

convert: not authorized `pictures.pdf' @ error/constitute.c/WriteImage/1028.
  • 1
    convert *.jpg pictures.pdf will overwrite all pdf files as one file pictures.pdf?
    – Vijay
    Commented Oct 7, 2018 at 17:11
  • This solution from StackOverflow worked for me: stackoverflow.com/questions/42928765/…
    – Mike
    Commented May 7, 2019 at 16:55

4 Answers 4


This problems comes from a security update: https://launchpad.net/ubuntu/+source/imagemagick/8:

Someone reported it as a bug: https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1796563

As a temporary fix, I edited /etc/ImageMagick-6/policy.xml and changed the PDF rights from none to read|write there. Not sure about the implications, but at least it allows me to get things done.

  • 1
    I looked into it again, and I'm almost certain that the security fix is related to kb.cert.org/vuls/id/332928 (which documents various ways to bypass -dSAFER in ghostscript).
    – YoungFrog
    Commented Oct 9, 2018 at 13:13
  • 3
    This indeed works as advertized. I simply commented out (effectively removed) the pdf-line. It would be good to know what the side-effects would be! The policymap in the config file comments that this is for "disable ghostscript format types". Commented Oct 22, 2018 at 12:00
  • 1
    See also: cromwell-intl.com/open-source/pdf-not-authorized.html Commented Dec 17, 2018 at 0:54
  • 3
    I was hesitant to change the security settings. As an alternative to imagemagick I used "pdftoppm -jpeg input.pdf output.jpg" (from package named poppler-utils). This alternative was posted in bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1796563 Commented Jan 18, 2019 at 23:31
  • Change destination file format policy respectively <policy domain="coder" rights="read|write" pattern="PDF" /> .Usually they will be at the end .Thanks
    – yunus
    Commented Apr 3, 2019 at 9:20

Fixed this on my Ubuntu 16.04.6 LTS and 18.04.6 LTS by following accepted answer.

Created simple sed one-liner to get this fixed faster:

sudo sed -i 's#<policy domain="coder" rights="none" pattern="PDF" />#<policy domain="coder" rights="read|write" pattern="PDF" />#' /etc/ImageMagick-6/policy.xml

and in programmatic way.


If you're worried about the implications, https://bugs.launchpad.net/ubuntu/+source/imagemagick/+bug/1796563 mentions that

While the release notes are not exactly clear, Ghostscript v9.25 seems to make reference to fixing some vulnerabilities of this sort: https://www.ghostscript.com/doc/9.25/News.htm


Disabling security limitations is a bad habit to get into. The ImageMagick authors presumably made this one for a reason. You should respect that, unless you know exactly what you are doing. That does not seem probable for most people looking at these answers.

The right thing to do in this case is to use other software which the authors themselves believe to be secure.

Here img2pdf fits the bill:

img2pdf --output out.pdf in.jpg
  • 1
    How does disrupting the normal convert command make your computer more secure?
    – ar2015
    Commented Jun 11, 2020 at 1:33
  • This doesn't answer the question. The question is to convert to PDF. Commented Jul 26, 2020 at 12:52
  • @ReinierPost Well noticed, thanks! Answer corrected.
    – Sqerstet
    Commented Jul 27, 2020 at 9:42
  • @Sqerstet: Thanks! I just tried it and it does exactly what I needed (it can create both an unresized version and a resized version for printing). Commented Aug 2, 2020 at 16:26
  • 1
    This works and seems to get the resolution right without any extra options.
    – Moondoggy
    Commented Jun 24, 2021 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .