Incorrect exit code when -quiet is used and a warning occurs.

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
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Incorrect exit code when -quiet is used and a warning occurs.

Post by broucaries » 2014-10-19T01:45:12-07:00

When running the following command:

identify -quiet -ping -format "%w %h\n" erroneous.jpg; echo $?

I get the following output

10 10
1

Without the -quiet option, I get an additional line of output:

identify: Corrupt JPEG data: 2 extraneous bytes before marker 0xdb `/home/boutil/debian/pkg-ruby-extras/ruby-mini-magick/spec/files/erroneous.jpg' @ warning/jpeg.c/JPEGWarningHandler/352.

According to the documentation for the quiet option, the warning should
be ignored.
With 8:6.8.8.9-3, the exit code was 0.

This change of behavior breaks a wrapper for ImageMagick, packaged as
ruby-mini-magick. Commands on erroneous images now are causing errors.

Erronous file is under https://bugs.debian.org/cgi-bin/bugrepo ... bug=763686

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

Re: Incorrect exit code when -quiet is used and a warning oc

Post by magick » 2014-10-19T06:44:02-07:00

Perhaps a transient bug. With ImageMagick 6.8.9-9 Beta, both identify commands (with and without -quiet) return a status of 0 as expected.

Post Reply