Hi,
I am trying to write a small program to automate my EXIF extraction and rotation for my images. My images are organized as:
year/month/date
And I would like to be able to call this script from any level in the tree. The idea is to call jhead everywhere to rotate and then to remove the EXIF info before proceeding to the next level.
My current program only goes one level in the tree. And I still dont understand why it doenst work. Can anyone tell me what I need to do to go from year and get to all my months, day by day? This script can go from the month and modify each day but that is all.
Here it goes:
Code:
#!/bin/bash
olddir=$PWD
processDir(){
cd "$olddir/$1"
echo "I am in $1"
ls
jhead -autorot -purejpg -exonly *.JPG
}
for dir in */
do
echo "Dir is $dir"
processDir "$1/$dir"
done
cd "$olddir"
Thank you for any suggestions.
--EDITED---
Actually, After I posted this I saw that my program simply doesnt recurse. So, now, all I need to do is to figure out how to add the processDir call in the processDir function to do what I want.