Pages

ImageMagic convert error: convert:not authorized `***` @ error/constitute.c/ReadImage/


Recently I got an error while converting from .tiff to .eps (Ubuntu 16.04 machine). This error happened for other file formats also. 


convert:not authorized `fileName.tif` @ error/constitute.c/ReadImage/***
convert:not authorized `fileName.pdf` @ error/constitute.c/ReadImage/***
convert:not authorized `fileName.png` @ error/constitute.c/ReadImage/***

A quick googling gave follwing solution.

Go to /etc/ImageMagic-c/

In this directory, edit the file policy.xml by using

sudo vi policy.xml

and edit the following lines.


<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="read|write" pattern="EPS" />
<policy domain="coder" rights="read|write" pattern="PDF" />
<policy domain="coder" rights="read|write" pattern="TIF" />
<policy domain="coder" rights="none" pattern="XPS" />


Note that I wanted to convert TIF file. So I added the line
<policy domain="coder" rights="read|write" pattern="TIF" />

So, by adding "read|write" in the rights option, it the ImageMagic convert will work now.

But, after doing your job, it is better to change to rights="none" because of the security issue (which the actual reason for disabling)


No comments:

Post a Comment

You may be interested in these posts

Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...