#!/bin/bash
BASE=/home/eka/bildscript
echo "
AP" > $BASE/index.html
for DIR in $BASE/*; do
if [ -d $DIR ]; then
echo "$DIR
" >> $BASE/index.html
if [ ! -d $DIR/thumbs ]; then
mkdir $DIR/thumbs
fi
echo "AP" > $DIR/index.html
for IMG in $(find $DIR -maxdepth 1 -iname '*.jpg' -printf '%f\n'); do
if [ ! -f $DIR/thumbs/tn.$IMG ]; then
convert -scale 160x120 $DIR/$IMG $DIR/thumbs/tn.$IMG
echo $IMG > /dev/stderr
fi
echo ""
echo "
"
done >> $DIR/index.html
echo "" >> $DIR/index.html
fi
done
echo "" >> $BASE/index.html