My Dotfiles
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.
 
 
 
 
 
 

17 lines
322 B

  1. #!/usr/bin/env bash
  2. #
  3. mkdir "portraits"
  4. mkdir "landscapes"
  5. for f in ./*.{jpg,jpeg,png,gif}; do
  6. if [ -f "$f" ]; then
  7. WIDTH=$(identify -format "%w" "$f")> /dev/null
  8. HEIGHT=$(identify -format "%h" "$f")> /dev/null
  9. if [[ "$HEIGHT" > "$WIDTH" ]]; then
  10. mv "$f" portraits/
  11. else
  12. mv "$f" landscapes/
  13. fi
  14. fi
  15. done