Find corrupted jpeg image files
find . -name "*jpg" -exec jpeginfo -c {} \; | grep -E "WARNING|ERROR"
11
Find corrupted jpeg image files
Finds all corrupted jpeg files in current directory and its subdirectories. Displays the error or warning found.
The jpeginfo is part of the jpeginfo package in debian.
Should you wish to only get corrupted filenames, use cut to extract them :
find ./ -name *jpg -exec jpeginfo -c {} \; | grep -E "WARNING|ERROR" | cut -d " " -f 1
Alternatives
There are 3 alternatives - vote for the best!
find . -iname '*jpg' -print0 | xargs -0 exiftool -warning; find . -iname '*jpg' -print0 | xargs -0 jpeginfo -c
0
This checks jpeg data and metadata, should be grepped as needed, maybe a -B1 Warning for the first, and a -E "WARNING|ERROR" for the second part....
Know a better way?
If you can do better, submit your command here.