#!/bin/sh # ImageOrientation.sh # Fri Dec 26 11:53:50 PST 2008 # Chieh Cheng # http://www.CynosureX.com/ # GNU General Public License (GPL) Version 2, June 1991 usage () { scriptName=`basename "$0"` echo " Usage: ${scriptName} \"file path\"" } if [ $# -eq 1 ] then imageFile="$1" if [ -f "${imageFile}" ] then resolution=`Resolution.sh "${imageFile}"` width=`echo "${resolution}" | Token.sh 1` height=`echo "${resolution}" | Token.sh 2` if [ ${width} -eq ${height} ] then echo "Square" else if [ ${width} -lt ${height} ] then echo "Portrait" else echo "Landscape" fi fi else "${imageFile} not found!" fi else usage fi