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
Status returned by "identify"
-
- 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?
This seems to be a new question, so I have split it to its own thread.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Status returned by "identify"
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"
It works for me. (6.9.1-3 on Cygwin bash)
In Windows, you can check %ERRORLEVEL% instead.
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
Code: Select all
>identify broken.jpg
identify.exe: Bogus marker length `broken.jpg' @ error/jpeg.c/JPEGErrorHandler/322.
>echo %ERRORLEVEL%
1