#!/bin/bash



echo "4 ---------------- Convert Tumbnail images to webp -----------------"
IMAGES=`find images/tumbnail -type f \( -iname \*.jpg -o -iname \*.bmp -o -iname \*.tiff  \)`   # Use the -o flag between different parameters.
webpQuality=50
for image in $IMAGES; do
	cwebp  -resize 300 0 -q $webpQuality $image -o ${image%%.*}.webp
done


echo "5 --------Make table of content file (00.TOC.tmp) of Tumbnails-------------"
find images/tumbnail -iname *.webp -printf "%f\n" > images/tumbnail/00.TOC.tmp

echo "Please edit the file images/tumbnail/00.TOC.tmp "
echo "Add the subject names in the second tab delimted column (identical to subject folders)"
echo "SAVE AS images/tumbnail/00.TOC.txt"

 