#!/bin/bash

# scale.wroclaw

testfile1="Austria.cloud.12.cc23.jpg"

if [ ! -e "$testfile1" ] || [ "`find "$testfile1" -mmin +1`" != "" ]
then
    ./maps
fi

testfile2="Austria.cloud.12.cc23.xpm.gz"

if [ ! -e $testfile2 ] || [ $testfile1 -nt $testfile2 ]
then
    for source in Austria.*.jpg
    do
	destination=`echo $source | sed 's#.*/##;s#\.jpg$##'`
	touch $destination
	montage $source -crop 54x54+315+217 -background gray -colors 256 -geometry 54x54 -size 54x54 +adjoin "$destination.xpm.gz"
    done
fi

