#
# Tells chimera how to convert different types of files
#
# access content method
#
# access is one of *, http gopher, ftp, cimg, mimg, gimg, ...
#   * will match any access
#   ftp, gopher, http are the usual access methods
#   cimg tells what to do with img on a color screen (kludge)
#   mimg tells what to do with img on a monochrome screen (kludge)
#   gimg tells what to do with img on a grayscale screen (kludge)
#   x-compress is used to decode compressed documents
#   x-gzip is used to decode gzip'd documents
#   add more when needed
#
# content can be anything to match the content-type
#
# method is how the file should be modified.
#   | open a pipe to the process and read from it.
#   http indicates that a pipe should be opened to a process, the
#     returned data is HTTP.
#
# NOTE: The Content-Type x-unknown/x-unknown is used for documents about
# which nothing is known.
#
# For example
#
# ftp x-unknown/x-unknown http text %s
#

#
# For the image conversion stuff, ppmquant can be used to limit the
# colors per image so documents with many images can be displayed.
#

# monochrome image conversion stuff for <img>
mimg image/gif			|chimera-giftoppm -mono %s 2> /dev/null
mimg image/x-xbitmap		|xbmtopbm %s 2> /dev/null
mimg image/x-xpixmap		|xpmtoppm %s 2> /dev/null | ppmtopgm 2> /dev/null | pgmtopbm 2> /dev/null
mimg application/postscript	|pstopxm pbmraw %s 2> /dev/null
mimg image/x-portable-graymap	|pgmtopbm %s 2> /dev/null
mimg image/x-portable-pixmap	|ppmtopgm %s 2>/dev/null|pgmtopbm 2>/dev/null

# grayscale image conversion stuff for <img>
gimg image/gif			|chimera-giftoppm -gray %s 2> /dev/null
gimg image/x-xbitmap		|xbmtopbm %s 2> /dev/null
gimg image/x-xpixmap		|xpmtoppm %s 2> /dev/null | ppmtopgm 2> /dev/null
gimg application/postscript	|pstopxm pgmraw %s 2> /dev/null
mimg image/x-portable-pixmap	|ppmtopgm %s 2> /dev/null

# color image conversion stuff for <img>
cimg image/gif			|chimera-giftoppm %s 2> /dev/null
cimg image/x-xbitmap		|xbmtopbm %s 2> /dev/null
cimg image/x-xpixmap		|xpmtoppm %s 2> /dev/null
cimg application/postscript	|pstopxm ppmraw %s 2> /dev/null

#
# Some alternates you may have to try.
#
#gimg image/gif                 |giftoppm %s 2>/dev/null|ppmtopgm 2>/dev/null
#cimg image/gif                 |giftoppm %s 2> /dev/null
#mimg image/gif                 |giftoppm %s 2> /dev/null | ppmtopgm 2> /dev/null | pgmtopbm 2> /dev/null
#cimg image/x-xbitmap		|xbmtopbm %s 2> /dev/null |pbmtopgm 1 1 2> /dev/null | pgmtoppm moccasin 2> /dev/null

ftp		application/x-compress	none
ftp		application/x-gzip	none

x-compress	*			|zcat < %s 2> /dev/null
x-gzip		*			|zcat < %s 2> /dev/null

*		text/html		none
*		text/x-compress-html	http wrapencode %s
*		text/x-gzip-html	http wrapencode %s
*               message/		http textencode %s
*		text/			http textencode %s
*		x-unknown/x-unknown	http textencode %s
*		x-unknown/x-unknown     http textencode %s
*		application/news-transmission http textencode %s
