diff --git a/thumbnailer.sh b/thumbnailer.sh index d8c8c7e..fcb93c7 100755 --- a/thumbnailer.sh +++ b/thumbnailer.sh @@ -20,7 +20,11 @@ pathtrans() { resize() { output=$(pathtrans $1) + if echo $1 | grep .gif > /dev/null; then + return + fi if [ ! -f ${output} ]; then + echo "generating thumbnail for $1" convert $1 -strip -auto-orient -resize ${SIZE} -dither FloydSteinberg -colors 16 ${output} fi replace $1 ${output} @@ -35,11 +39,14 @@ replace() { src=$(echo "src='${src}'") dest=$(echo "src='${dest}'") + echo -n "modifying html to use thumbnail for $1" for f in $(find ${ROOT}/*.html); do - if grep ${src} ${f}; then + echo -n "." + if grep ${src} ${f} > /dev/null; then sed -i s#${src}#${dest}# $f fi done + echo } echo "creating new thumbnails"