How to solve convert-im6.q16 issues

If you try to convert multiple jpg to a single pdf probably you will see this message:

$ convert `ls -1v` file.pdf


convert-im6.q16: Corrupt JPEG data: 94 extraneous bytes before marker 0xd9 `0.jpeg' @ warning/jpeg.c/JPEGWarningHandler/352.
convert-im6.q16: not authorized `pictures.pdf' @ error/constitute.c/WriteImage/1056.

To solve the first issue just convert the files to png and after to jpg again, like this example:

mogrify -format png *.jpg
rm *.jpg
mogrify -format jpg *.png
rm *.png



To solve the second, just execute the following command:

sudo sed -i 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/g' /etc/ImageMagick-6/policy.xml

Enjoy it!



Comments

Popular posts from this blog

How to fix Android when developer options are not available for this user

Exception: Could not find a default OpenFlow controller in Mininet

v4l2: open /dev/video0: Permission denied