We discovered some broken images on the file server; it turned out they were TIFFs, but named *.jpg. I wrote this quick script to check all the images on the server. It found 44, which we'll replace when we have the chance.
#!/bin/bash
echo "Checking all images to see if they are really images."
> temp.txt
find . -iname "*.jpg" -type f -print0 | while IFS= read -r -d $'\0' file;
do
INFO=`file "$file"`
if ! [[ $INFO =~ 'JPEG' ]]; then
echo "$file" >> temp.txt
fi
done
let lines=`wc -l < temp.txt`
echo "List of images which are not real JPEGs." > falseJpegs.txt
echo "----------------------------------------" >> falseJpegs.txt
echo "" >> falseJpegs.txt
sort temp.txt >> falseJpegs.txt
echo "Found $lines broken images, listed in falseJpegs.txt."