Status returned by "identify"

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bit2fire
Posts: 1
Joined: 2015-08-05T08:13:51-07:00
Authentication code: 1151

Status returned by "identify"

Post by bit2fire »

hello Everyone,
My question is that when i run this statement "indentify -regard-warnings corrupat.jpg" in Command line it doesn't give any status(like value 0,1) so that i could find that image is corrupt or not. so kindly help me to resolve this Issue.
thanks in advance for your kind attention



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

Re: Mogrify doesnt work in .bat-file. What to do?

Post by snibgo »

This seems to be a new question, so I have split it to its own thread.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Status returned by "identify"

Post by fmw42 »

Try adding 2>&1 to your command and see if that helps

Code: Select all

identify -regard-warnings corrupat.jpg 2>&1
246246
Posts: 190
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: Status returned by "identify"

Post by 246246 »

It works for me. (6.9.1-3 on Cygwin bash)

Code: Select all

$ identify test.jpg
test.jpg JPEG 500x500 500x500+0+0 8-bit CMYK 16.6KB 0.000u 0:00.000

$echo $?
0

$ tr '\003' '\002' < test.jpg > broken.jpg

$ identify broken.jpg
identify: Bogus marker length `broken.jpg' @ error/jpeg.c/JPEGErrorHandler/322.

$ echo $?
1
In Windows, you can check %ERRORLEVEL% instead.

Code: Select all

>identify broken.jpg
identify.exe: Bogus marker length `broken.jpg' @ error/jpeg.c/JPEGErrorHandler/322.

>echo %ERRORLEVEL%
1
Post Reply