#!/bin/sh
# script to resize and crop
dir="/Users/data/files/candidate/photo/"
resume=resume
orig=_orig
cd "$dir$orig"
for k in `ls *.jpg`
do
h=`identify -format "%h" $k`
w=`identify -format "%w" $k`
#echo "$k, w:$w, h:$h"
if [ $w -ge $h ]
then
convert $k -resize x72 -crop 72x72+0+0 "$dir$resume/$k"
else
convert $k -resize 72x -crop 72x72+0+0 "$dir$resume/$k"
#echo "portrait"
fi
done