suggestion: improved error message compared to "not authorized"

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
RichardNeill
Posts: 4
Joined: 2011-03-16T12:36:52-07:00
Authentication code: 8675308

suggestion: improved error message compared to "not authorized"

Post by RichardNeill »

I just spent a very long time tracking down the source of the error message in my web application:
convert: not authorized `upload.pdf' @ error/constitute.c/ReadImage/412.
This is because I assumed "not authorized" meant something to do with file permissions, directory permissions, apache's systemd private /tmp, etc.
This assumption is, I think, entirely reasonable... but it turns out to be wrong: it's a policy.xml issue (because ImageMagic has now upgraded to a version that doesn't do PDFs by default).

Please could you make this error message a bit more explicit, so that users who see it are pointed in the right direction? I propose:
"convert: format not authorized by policy.xml `upload.pdf' @ error/constitute.c/ReadImage/412."
This way, I'd get the hint that this is something unexpected that is to do with imagemagick's configuration.

Another thing that is confusing is that the full error message reads:
convert: not authorized `upload.pdf' @ error/constitute.c/ReadImage/412.
convert: no images defined `output.jpg' @ error/convert.c/ConvertImageCommand/3258.

I think after the first error, convert should quit: the 2nd errormessage is actually a bit misleading.

Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: suggestion: improved error message compared to "not authorized"

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.
Post Reply