#!/bin/sh
#
# usage: sh run basename "pl-opts"
#
# loose option gives result that is loosely cropped.
# normally, tight crop is used.

if [ $# -lt 1 ]; then 
  echo "usage: sh run basename pl-opts"
  exit
fi

SCALE=0.3

if [ $# -eq 2 ]; then
  echo ploticus -gif $1.htm $2 -o $1.gif
  ploticus -gif $1.htm $2 -o $1.gif
else
  echo ploticus -gif -tightcrop $1.htm -o $1.gif
  ploticus -gif -tightcrop $1.htm -o $1.gif
fi

echo ploticus -gif -scale $SCALE $1.htm $2 -o ../thumbnails/$1.gif
ploticus -gif -scale $SCALE $1.htm -o ../thumbnails/$1.gif


echo ploticus -png -scale $SCALE $1.htm $2 -o ../thumbpng/$1.png
ploticus -png -scale $SCALE $1.htm -o ../thumbpng/$1.png
