I have a somewhat-kludgey script in which I want to copy valid, complete JPEG files to a photo album directory. I thought I could use ImageMagick's identify command to do this. The web documentation for that command says The identify program describes the format and characteristics of one or more image files. It also reports if an image is incomplete or corrupt.... which sounds great. And if I run identify jpeg:testfile.jpg, I get an exit code of 0 if the test file is a JPEG, and 1 if it isn't. Good start  but the command also returns 0 if the file appears to be a JPEG but is incomplete.I looked through the extensive list of options, but nothing seems relevant. Can I use this command to do what I want? How?
How can I use imagemagick's identify command in a script to tell if a JPEG file is invalid or corrupt?
scripting;imagemagick
If an alternate program is an option, I think I used jpeginfo -c the last time I needed to check the validity of a bunch of JPEG files.