So I've been working at this for a while and I think I'm ready to give up. I trying to process sub-folders with imagemagick's montage
to create contact sheets.
This is basically as close as I've gotten:
find '/dir-with-spaces/' -type f -regex ".*\.\(JPG\|jpg\|jpeg\|JPEG\)" -print0 | \
while IFS= read -r -d $'\0' line;\
do \
montage "$line" "${line}".jpg; \
done
Using this command, Montage processes each picture individually. The behaviour I want is for find to search down the lowest directory for pictures, back up, send that all to montage
and then continue on the the next folder with the resulting contact sheet named with the entire folder tree.
i.e.:
/media/pictures/folder1/folder2/pic1.jpg...pic100.jpg --> media-pictures-folder1-folder2.jpg
A few other things I've tried to come up with are:
#This just hangs montage forever
find . -name *.jpg -printf '%h\n' | sort -u | xargs -I {} montage {}/*
#I need a "+" here for -execdir, but I don't think I can use it with montage's argument structure.
find . -name *.jpg -execdir montage {} test.jpg \;
The directory structure is something like:
folder1
folder1_1
folder1_2
folder1_3
*.jpg
folder2
folder2_1
*.jpg
folder3
folder3_1
folder3_2
folder3_4
folder3_5
*.jpg
Running Ubuntu 14.10
Any help on this would be greatly appreciated.