Jim's Depository

this code is not yet written
 

Certain corrupt JPEG files will explode Quicktime Player if it encounters them in an “Import Image Sequence…” operation. This bug has been present for many years and shows no sign of going away.

If you are archiving images from cheap webcams you will encounter these.

I am not aware of anything included with Mac OS X Leopard that validates a JPEG file, so I built jpeginfo for Leopard. 

With that, you can do things like… for v in *.jpg ;do jpeginfo -c \$v || rm \$v ;done … to delete all the corrupted JPEGs.

You can find the sources at http://www.iki.fi/tjko/projects.html You will also need to build libjpeg, from ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz

Build libjpeg first (./configure ; make ), then build jpeginfo (./configure –with-libjpeg=THE-RIGHT_DIRECTORY ; make )

But you don’t need to do that… I’ve attached the copy I built.

Attachments

jpeginfo 103388 bytes
I might mention that there are still some jpegs that will crash the quicktime encoder that are valid according to jpeginfo, but it gets most of them.
I found a much simpler solution, there is a tool 'Corrupt JPEG Checker' for Mac OSX.
It can be found here: http://www.failedinsider.com/corruptjpegcheckermacosx/ or in the mac app store.

Saved me a lot of time.

http://www.failedinsider.com/corruptjpegcheckermacosx/
unfortunately JPEGInfo will not catch all.

the tool above catches the rest