Page 1 of 1

Status returned by "identify"

Posted: 2015-08-05T08:36:40-07:00
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

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

Posted: 2015-08-05T08:40:37-07:00
by snibgo
This seems to be a new question, so I have split it to its own thread.

Re: Status returned by "identify"

Posted: 2015-08-05T09:20:36-07:00
by fmw42
Try adding 2>&1 to your command and see if that helps

Code: Select all

identify -regard-warnings corrupat.jpg 2>&1

Re: Status returned by "identify"

Posted: 2015-08-05T17:33:58-07:00
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