Trying to locate corrupt JPG files in Very Large Directory

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
Spinman
Posts: 2
Joined: 2011-01-17T21:45:32-07:00
Authentication code: 8675308

Trying to locate corrupt JPG files in Very Large Directory

Post by Spinman »

Hope someone will be able to point me in the right direction...

I have a windows directory with 17,000 jpg photos.
The application that accesses these photos is crashing when I try to load the directory - which tells me that there is at least one corrupt file in the directory.

Was thinking that I could use the dos window command line "identify *.*" to find my problem files - but the output shows the results for all files.

Is there anyway that I can filter the results to show only the corrupt files - or another way I can easily find my problem files?

In the past I was able to stumble upon several files that did not display a preview properly - but with 17,000 - it's too hard to stumble across a problem file...


Thanks so much...
markmarques
Posts: 88
Joined: 2010-06-29T14:36:09-07:00
Authentication code: 8675308

Re: Trying to locate corrupt JPG files in Very Large Directo

Post by markmarques »

An idea would be using the convert command line options and then format the output ...
Check : http://imagemagick.org/script/escape.php

something in the likes :

convert *.jpg -identify -format %[EXIF:tag]

If an image does not have the EXIF part it might be an GIF ....

Although I suppose the problem might be a PNG / GIF file mis-renamed as JPEG or JPG and the programs due give that kind of error ...
Spinman
Posts: 2
Joined: 2011-01-17T21:45:32-07:00
Authentication code: 8675308

Re: Trying to locate corrupt JPG files in Very Large Directo

Post by Spinman »

Just to close the loop - I ended up using a freeware program I found on the web called "Bad Peggy".

It ran thru my entire directory and identified 2 jpg's that were corrupt. Manual deletion - and all it well.
Post Reply