mgetty fix, NetPBM related

Gert Doering (gert@greenie.muc.de)
Mon, 23 Aug 1999 15:31:25 +0200


Hi,

(I'm including the mgetty list in my reply, as this *is* interesting to
many of the readers, and hasn't yet been documented properly [I'm sooo
lazy] - this is the reason why I'm quoting pretty long parts of your
e-mail, because otherwise it's hard to understand the thread).

On Sun, Aug 15, 1999 at 04:54:56AM -0600, Warren Young wrote:
> There's a problem in the faxspool script distributed with
> mgetty+sendfax.  (At least, as packaged by Red Hat.)  It relies on
> giftoppm, which is apparently no longer part of the NetPBM package. 
> Instead, you're supposed to use giftopnm.
> 
> In the function fs_cvt_gif, the conversion pipeline can be changed to
> the following and work (apparently) correctly:
> 
>     giftopnm $1 |\
>     pnmscale -xysize 1728 2000 |\
>     $REDUCE |\
>     pgmtopbm |\
>     pbm2g3 >$2.001

The problem with this is that it won't work on systems that do not have
"netpbm", but have "pbmplus".  So there is no "correct" default here (on
my own machine, I run pbmplus, and there is no giftopnm...)

BUT there is hope :-) - in mgetty 1.1.21, you can define the rules that
faxspool uses in an external program, "faxspool.rules" (in the CONFDIR,
usually something like /usr/local/etc/mgetty+sendfax/faxspool.rules).

Faxspool.rules actually has two sets of rules:

a) mapping of file extentions to "file types" - with this, you can tell
   faxspool, for example, that ".pic" is really a "gif", and should be
   converted as anything else that maps to "gif".

   The syntax of this is SUFFIX <suffix> <type>, like this:

   SUFFIX .g3 g3
   SUFFIX .asc ascii
   SUFFIX .txt ascii
   SUFFIX .ps ps
   SUFFIX .lj lj
   SUFFIX .pcl lj

   (this is not necessary in your case, but I include it for documentation
   purposes)

b) mapping of "file types" to "conversion rules" - with this, you tell
   faxspool *how* to convert a "gif" to a G3 file.  The syntax is

   FILTER <type> <command>

   where in <command>, "$1" is replaced by the input file name and
   "$2" is replaced by the output file name (prefix, for multi-page
   output).  In the GIF case, this could look like this:

   FILTER gif  giftopnm $1 | pnmscale -xysize 1728 2000 | ppmtopgm | pgmtopbm | pbm2g3 >$2.001

   (note: normal/high res differenciation can be done by looking at "$3",
   but that's kind of ugly, there will be a better solution "soon").

> I'd like to send my compliments to you for this program, by the way. 
 [..]

Thanks for that :-)

gert
-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             gert@greenie.muc.de
fax: +49-89-35655025                        gert.doering@physik.tu-muenchen.de