Why does Imagemagick rant that much for non exisiting files?

Post here to shower the ImageMagick developers with praise or discuss how you could have done a better job if you developed ImageMagick. Or talk about how Photoshop is better than ImageMagick. Even complain about how no one answered your postings in the Users forum. Venting and musings welcomed here.
Post Reply
Jean-Pierre Coulon
Posts: 22
Joined: 2016-10-04T02:08:22-07:00
Authentication code: 1151
Location: Nice, France

Why does Imagemagick rant that much for non exisiting files?

Post by Jean-Pierre Coulon » 2017-07-21T12:50:07-07:00

If I say imagemagick nonexisting.jpg myresult.png I obtain 10 lines of rant with: unable to open... no image to apply... [3 times] unknown image property... [3 times]. Is'nt 1 line enough? Imagemagick won't let me save this rant saying imagemagick nonexisting.jpg myresult.png>myrant.txt.

snibgo
Posts: 9485
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Why does Imagemagick rant that much for non exisiting files?

Post by snibgo » 2017-07-21T13:01:53-07:00

Text errors and warnings go to stderr, not stdout, so to capture them use "2>myrant.txt".

When the input doesn't exist, v6 gives me only three errors, but v7 gives 1 error and 6 warnings. You can disable warnings with "-quiet".
snibgo's IM pages: im.snibgo.com

User avatar
glennrp
Posts: 1163
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Why does Imagemagick rant that much for non exisiting files?

Post by glennrp » 2017-07-28T17:48:33-07:00

Im6 only emits 2 lines while im7 seems to get into "property.c" with invalid input.
Also, "magick convert nothing.jpg nothing.png" only emits one line. It's just when
the "convert" is omitted that you get extra complaints from property.c.

It looks as though magick is stumbling into line 819 of MagickWand/magick-cli.c
after the image reader fails.

So, your solution is to use "magick convert ..." instead of "magick ..."

Post Reply