#! /bin/csh -f

# makes an icon for a simple .ppm povray output

set fn = "$1"
set name = ${fn:t}
set dir = ${fn:h}
if ( "x${dir}" != "x${name}" ) then
  cd $dir
endif
set name = ${fn:r}

set ppm = ${name}.ppm
set gif = ${name}.gif
set icon = ${name}-icon.gif

rm -f ${gif} ${icon} {p,q}.{gif,ppm}
rm -f {p,q}-*.{gif,ppm} 
rm -f {p,q}.html-inc
nice linear-ppm-to-gif ${ppm} > ${gif}
nice linear-ppm-to-gif -ysize 050 ${ppm} > ${icon}
ln -s ${ppm} p.ppm
ln -s ${gif} p.gif
ln -s ${icon} p-icon.gif
