Posts

Showing posts with the label convert

ImageMagick cache resources exhausted

If you are trying to merge multiple images in a pdf you can use "convert" command, and probably will see the following message: convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408. to enable this operation, you must edit the policy.xml file from ImageMagick. This file is located in /etc/ImageMagick-6/policy.xml (if the path doesn't exist, just write /etc/ImageMagick and press Tab). Add the following line before </policymap> <policy domain="coder" rights="read | write" pattern="PDF" /> Also, other common issue is the following: convert-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244. convert-im6.q16: cache resources exhausted `source.jpg' @ error/cache.c/OpenPixelCache/3984. To solve this, just increase the cache resources in disk value. Replace: <policy domain="resource" na...

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!