'convert' exit status is zero (success) when arguments are not understood

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
spookylukey
Posts: 2
Joined: 2015-10-15T12:49:03-07:00
Authentication code: 1151

'convert' exit status is zero (success) when arguments are not understood

Post by spookylukey »

If you pass too few arguments to convert:

Code: Select all

convert rubbishrubbish
it prints help, but exits with status code 0, indicating success.

This is obviously really bad behaviour, especially for scripts which rely on error codes.

So far I've only found this happening when you fail to pass enough arguments, but perhaps there are other ways to trigger this too. It works correctly if you pass an option that doesn't exist.
spookylukey
Posts: 2
Joined: 2015-10-15T12:49:03-07:00
Authentication code: 1151

Re: 'convert' exit status is zero (success) when arguments are not understood

Post by spookylukey »

Forgot version numbers:
> convert -version
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
Running on Linux Mint.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: 'convert' exit status is zero (success) when arguments are not understood

Post by dlemstra »

The current version of ImageMagick (6.9.2-4) does not have this kind of behavior. It set the exit status to '1' with your command. I would suggest you to upgrade to a more recent version. Your version is over 3 years old.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply