#!/bin/bash

IMAGES_DIR="./images"
WIDTH=320

mkdir -p ./images/thumbnails

for f in ./images/*
do
  case "$f" in
    *.jpeg|*.jpg|*.png|*.webp|*.gif)
      echo "Processing $f"
      convert $f -resize $WIDTH\> ./images/thumbnails/th_`basename $f`
      ;;
    *)
      echo "Ignoring $f"
      ;;
  esac
done
