Michael Lossin on Tue, 23 May 2000 11:04:33 +0200 (CEST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

apsfilter tweaks'n'twiddles


And you thought it was over...

In the quest for the "apsolute" filter, I stumbled over some more stuff:

* dvips could use the "-R" switch (secure mode)

* Some color glitches:

- djpeg reduces the image down to 256 colors, which is unnecessary
- html2ps knows "-g" to produce grayscale PostScript ("${MONO:+-g}")

* Support for more file formats: (file 3.28)

format  file(1) result          possible filters (for pnm or ps output)

fits    "FITS image data"       convert, fitstopnm
miff    "MIFF image data"       convert
pcd     "Kodak Photo CD"        convert, hpcdtoppm (needs file as input)
                                pcdtoppm (needs file as input, output
                                to stdout with "-")
rle     "RLE image data"        convert
sgi     "SGI image data"        convert, sgitopnm
tga     "Targa image data"      convert, tgatoppm
xcf     "GIMP XCF image data"   xcftopnm

* Alternative (usable) tools for file types already known to apsfilter:

- convert (gif, jpg, tiff, pnm, g3fax, bmp, sunraster, xpm)
- tiff2ps, fax2ps (from libtiff)

* I haven't fully tested this, but a reasonable convert line seems to be

        convert -rotate -90\> -page "$PAPERSIZE" \
        ${MONO:+-colorspace GRAY} - ps2:-

I used "-rotate -90>" to rotate the image ccw when the width exceeds the
height, just as pnmtops does. (The > must be quoted properly -- don't
ask me why they used that for a special switch...)

This line applies to all supported formats, so it would be best to put
it in a separate function or alias.

* "set -C" is a nice shell feature, but wouldn't it be easier to use
"[ -e "$open_tmp_file__file" ] && fatal_tmp_file" instead? I'm sure this
is much more portable.

* I don't have a serial printer, so this is derived from documentation:
LPRng requires the ms printcap entry (and its aliases sy and ty) to
contain a valid stty parameter line, e.g.

        :ms=ixon -imaxbel -ixany -ixoff -crtscts:

-- without the commas, as used in SETUP. My BSD-printcap man page
doesn't even know ms, but seems to favour the (very ugly) fc and fs
switches.


Bye
Michael