Sunday, October 14, 2018

imagemagick / convert error when converting a group of jpgs to a pdf. introduced as an inconvenience / bug


The latest set of security updates on Ubuntu seems to have jacked up the imagemagick settings.

Have to do the change suggested in the following tip from Ubuntu questions.

https://askubuntu.com/questions/1081695/error-during-converting-jpg-to-pdf

Problem:

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.
 
Solution as of Oct 7 2018
 
This problems comes from a security update: https://launchpad.net/ubuntu/+source/imagemagick/8:6.8.9.9-7ubuntu5.13
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.
 
copy original, comment out, then edit copy to add read|write

this is from version 6.  Version 7 combines them into a single statement for pattern= clause.
  <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
  <policy domain="coder" rights="read | write" pattern="PDF" />

Another reference



--30--

1 comment:

  1. Thank you for this! This has helped me get around a problem I had in exporting layers to pdf using GIMP that I have in both linux and windows environments.

    ReplyDelete