#!/bin/bash

#rm HEADER.html
touch HEADER.html

for image in P[a-zA-Z0-9]*.JPG; do
    i=${image%%.JPG}
    echo $image
    jpegtopnm $image | pnmscale -xysize 100 100 | pnmtojpeg > _thumb${i}.jpg
    echo "<a href=\"${image}\" target=\"new\"><img src=\"_thumb${i}.jpg\"></a>" >> HEADER.html
done

