You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
322 B

#!/usr/bin/env bash
#
mkdir "portraits"
mkdir "landscapes"
for f in ./*.{jpg,jpeg,png,gif}; do
if [ -f "$f" ]; then
WIDTH=$(identify -format "%w" "$f")> /dev/null
HEIGHT=$(identify -format "%h" "$f")> /dev/null
if [[ "$HEIGHT" > "$WIDTH" ]]; then
mv "$f" portraits/
else
mv "$f" landscapes/
fi
fi
done