The trusty ImageMagick package

 


Seven years ago I made a simple script to turn a pile of scanned exams into a personalized email for each student to get their marked exams. I used our photocopy machine that doubles as a scanner to create a large PDF file containing all the exams.

ImageMagick's convert, identify and mogrify commands were used within the script for several massaging of the scanned pages but, years later, using WSL instead of a Linux machine, I was shown a weird error. None of the commands seemed to be able to handle a PDF file as a source anymore:

identify-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.

Luckily, I quick search lead me to a solution: just edit /etc/ImageMagick-6/policy.xml and enable PDF use, which was disabled as a safety feature as PDF can be an attack vector. More info.

Comments

Popular posts from this blog

VFD control with Arduino using RS485 link

How to get sinusoidal s-curve for a stepper motor

Stepper motor step signal timing calculation