сряда, 28 ноември 2018 г.

convert jpg to pdf error

Obviously, ImageMagick has some vulnerability which is "solved" by stopping it do what you would expect it to do. Like covert jpg or png files to a pdf. I was quite surprised by this, but luckily people have found a way to solve it (read here):

$ sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xmlout
$ convert *.jpg my_new.pdf
$ sudo mv /etc/ImageMagick-6/policy.xmlout /etc/ImageMagick-6/policy.xml

It's tempting to permanently edit the rules and to remove the line, but then I do that probably once a year, so I can easily type 3 lines instead of 1. And safety above all, lol.