#! /bin/sh
#
# Copyright 2002 S. Varshavchik.  See COPYING for
# distribution information.
#

. ${prefix}/share/faxmail/init

cat >$OUTDIR/.gif
/usr/bin/giftopnm $OUTDIR/.gif >$OUTDIR/.pnm
rm -f $OUTDIR/.gif
/usr/bin/pnmscale -xysize 1728 2000 $OUTDIR/.pnm >$OUTDIR/.pnm2 2>/dev/null
rm -f $OUTDIR/.pnm

if test "$FAXRES" = "lo"
then
	/usr/bin/pnmscale -yscale 0.5 $OUTDIR/.pnm2 >$OUTDIR/.pnm 2>/dev/null
	mv $OUTDIR/.pnm $OUTDIR/.pnm2
fi

/usr/bin/ppmtopgm $OUTDIR/.pnm2 >$OUTDIR/.pgm
rm -f $OUTDIR/.pnm2
/usr/bin/pgmtopbm $OUTDIR/.pgm >$OUTDIR/.pbm
rm -f $OUTDIR/.pgm
/usr/bin/pbmtog3 $OUTDIR/.pbm >$OUTDIR/f0001.g3
