Created
January 9, 2014 00:13
-
-
Save trodemaster/8327176 to your computer and use it in GitHub Desktop.
badpeg.sh sell script for validating jpeg files using imagemagick. Adds a hyphen to the end of the filename if the test fails.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# rename bat jpg files | |
# usage with large number of files | |
# cd to the directory containing the images | |
## ls ./ | xargs badpeg.sh | |
for filename in "$@" | |
do | |
#lastPix=`convert $filename -format "%[pixel: u.p{699,465}]" info:` | |
#echo $lastPix | |
if [[ `convert $filename -format "%[pixel: u.p{699,465}]" info:` == fractal ]] | |
then | |
mv $filename $filename"-" | |
echo $filename is a bad jpeg | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment