My correspondence with Anthony Thyssen on this topic (where bogus.png does not exist). I was working with IM v6.3.5.7
| If I do the following:
|
| if convert -regard-warnings "bogus.png" "tmp.png"
| then
| : ' do something else'
| else
| echo "--- cannot read input file ---"
| exit 1
| fi
|
|
| Then I get:
|
| convert: unable to open image `bogus.png': No such file or directory.
| convert: unable to open file `bogus.png'.
| convert: missing an image filename `tmp.png'.
| --- cannot read input file ---
|
|
| If I add -quiet as follows:
|
| if convert -regard-warnings -quiet "bogus.png" "tmp.png"
| then
| : ' do something else'
| else
| echo "--- cannot read input file ---"
| exit 1
| fi
|
|
| then I still get the same result:
|
| convert: unable to open image `bogus.png': No such file or directory.
| convert: unable to open file `bogus.png'.
| convert: missing an image filename `tmp.png'.
| --- cannot read input file ---
|
That is a definate BUG. (Anthony)
-quiet mode not working
Re: -quiet mode not working
The -quiet option suppresses warnings. The output you are receiving is an error.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: -quiet mode not working
Okay then the alternative is to capture the error output and print it at the appropriate time. Eg
Code: Select all
error=`convert -quiet -regard-warnings ...... 2>&1`
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/