#!/bin/sh
#
# converts a gif to a xpm
# uses netpbm
#
# 18. Januar 2002
# Diether Knof

if [ $# == 0 ]; then
  > image.gif
  file="image.gif"
elif [ $# == 1 ]; then
  file=$1
else
  echo "Please give no more than one filename"
  exit 0;
fi

giftopnm -alphaout=- \
	${file} \
	> mask.pbm
giftopnm ${file} \
	| ppmtoxpm -alphamask=mask.pbm

rm mask.pbm
if [ $# == 0 ]; then
  rm ${file}
fi