#!/bin/sh
#
# Author:
#   Leif Kornstaedt <kornstae@ps.uni-sb.de>
#
# Copyright:
#   Leif Kornstaedt, 1998
#
# Last change:
#   $Date: 2003-05-06 16:11:48 +0200 (Tue, 06 May 2003) $ by $Author: glynn $
#   $Revision: 15483 $
#
# This file is part of Mozart, an implementation of Oz 3:
#   $MOZARTURL$
#
# See the file "LICENSE" or
#   $LICENSEURL$
# for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL
# WARRANTIES.
#

if [ $# -ne 2 ]
then
    echo usage: `basename $0` \<input file\> \<output file\> 1>&2
    exit 2
fi

infile=$1
outfile=$2

case "$1" in
    *.gif) giftopnm $infile | pnmscale -ysize 50 | ppmquant 256 | pnmtopng > $outfile;;
    *.png) pngtopnm $infile | pnmscale -ysize 50 | ppmquant 256 | pnmtopng > $outfile;;
    *) echo "unsupported file type" >&2; exit 1;;
esac

