#!/bin/sh
#
# Author:
#   Leif Kornstaedt <kornstae@ps.uni-sb.de>
#
# Copyright:
#   Leif Kornstaedt, 1998
#
# Last change:
#   $Date: 2003/02/04 17:31:23 $ by $Author: kuhlmann $
#   $Revision: 1.2.8.1 $
#
# 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

