Last active
December 11, 2021 08:30
-
-
Save gamunu/7119595660280b5965a977f179b9e2b2 to your computer and use it in GitHub Desktop.
Move all files with low resolution to backup location
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
function mvImgBySize | |
{ | |
minX=128 | |
miny=96 | |
xres=`identify -format "%[fx:w]" "$1"` | |
yres=`identify -format "%[fx:h]" "$1"` | |
if [ $xres -lt $minX ] || [ $yres -lt $minY ] | |
then | |
mv "$1" /path/to/backup/location/ | |
fi | |
} | |
export -f mvImgBySize | |
find /path/to/basedir/with/pictures/ -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.resOriginalRes" -o -name "*.HEIC" -exec bash -c 'mvImgBySize "$0"' "{}" \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment