#!/bin/bash

html='overview.html'
echo "<html><head><link rel="stylesheet" href="mystyle.css"></head><body><table>" >$html
for y in $(seq -s' ' 16 -1 4); do
    echo "<tr>" >>$html
    for x in $(seq 1 13); do
        echo $x,$y;
        echo "<th>" >> $html

        full=fullres/antlia_r__$x-$y.png
        small=small/small_$x-$y.jpg
        if [ ! -f $small ]
        then
            echo "makeing previews for $x,$y"
            convert $full -crop 4000x4000+100+100 -scale 10% $small
        else
            echo "reusing small for $x,$y"
        fi
        echo '<a href="'$full'" target="_blank"><img src="'$small'"></a>' >>$html 
        echo "</th>" >> $html
    done
    echo "</tr>" >>$html
done

echo "</table></body></html>" >>$html
