#!/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
