#!/bin/sh

set -e

cd "$(dirname "$0")"

. ./settings

cd ..

mkdir -p thumbnails-small

cd thumbnails
for x in *; do
    large=$x
    small=../thumbnails-small/$x
    if ! [ -f $small ] || [ $large -nt $small ]; then
	magick $x -resize x"$thumbnail_height" $small
    fi
done
