Created
October 15, 2012 07:39
-
-
Save nemobis/3891238 to your computer and use it in GitHub Desktop.
Silly script to find interlaced images on Commons (bug 17645)
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/bash | |
# commons-interlace.sh: silly script to find interlaced images on Commons | |
cat jpgcommons.txt | # Take list of filenames, one per line | |
while read line # As long as there is another line to read ... | |
do | |
URL=$(curl "http://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=url&titles=File:$line&format=xml" | grep -oE 'http://upload.wikimedia.org[^"]+'); | |
echo "URL is $URL" | |
IDEN=$(curl $URL | identify -verbose -) | |
if grep -qi "Interlace: None" <<< $IDEN; then | |
echo ">>>>>>> $line is not interlaced <<<<<<<" #Only if we found it and exit status is 0 | |
else | |
echo ">>>>>>> $line is interlaced <<<<<<<" | |
echo "$line" >> interlaced.txt | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment