Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo 'This is the list of images to delete. The format is path - width x height.'
- for file in "$1"*.{jpg,png}; do
- if [[ -f "$file" ]]; then
- width=$(identify -format %w\\n "$file" -quiet)
- height=$(identify -format %h\\n "$file" -quiet)
- should_be_height1=$((($width/16)*9))
- should_be_height2=$((($width/16)*10))
- if [ "$should_be_height1" -ne "$height" -a "$should_be_height2" -ne "$height" ]; then
- echo $file - $width'x'$height
- echo $file >> .temporal
- fi
- fi
- done
- echo 'Do you want to delete them? YES/no'
- read response
- if [ $response = 'YES' ]; then
- while read line; do
- echo rm $line
- done < .temporal
- rm .temporal
- else
- echo 'OK man, your files are still there! :)'
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement