diff --git a/.gitignore b/.gitignore index a56a7ef..06a9b9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules +images/thumbnails diff --git a/scripts/process-images.sh b/scripts/process-images.sh index 31849a6..2950541 100755 --- a/scripts/process-images.sh +++ b/scripts/process-images.sh @@ -1,27 +1,17 @@ #!/bin/bash IMAGES_DIR="./images" - -WIDTH= +WIDTH=320 for f in ./images/* do - echo "Processing $f" case "$f" in - *.jpeg|*.jpg) - convert $f [320] ./images/thumbnails/`basename $f`; - ;; - *.png) - echo "PNG $f" - ;; - *.webp) - echo "WEBP $f" - ;; - *.gif) - echo "GIF $f" + *.jpeg|*.jpg|*.png|*.webp|*.gif) + echo "Processing $f" + convert $f -resize $WIDTH ./images/thumbnails/th_`basename $f` ;; *) - echo "OTHER ${f}" + echo "Ignoring $f" ;; esac done