[sane-devel] Epson 2450: scanimage produces invalid PNM files

Roland Roberts roland@astrofoto.org
13 Apr 2002 17:53:33 -0400


>>>>> "Oliver" == Oliver Rauch <oliver.rauch@rauch-domain.de> writes:

    Oliver> I did some test with 16 bit images and xv and
    Oliver> display/imagemagick.

    Oliver> 1) 16 ascii pnm images are displayed correct by xv, they
    Oliver>    are black in display. The image contains values up to
    Oliver>    6xxxx, so xv does it right and display does it wrong.

It contains the correct values when read on Intel as native format.
But the files are not transferrable to any other architecture because
they do not behave as libpnm expects.

    Oliver> 2) there is no 16 bit pnm raw image type defined. So there
    Oliver>    can be no wrong byte order. xv does read 16 bit raw pnm
    Oliver>    images in the byte order of the machine (low byte first
    Oliver>    for ix68).

The libpnm, libpgm, libppm code expect MSB first.  XSane does the
right thing by bypassing the raw format and writing plain format.  I
can find nothing in the pgm/ppm documentation off-hand which documents
this behavior (MSB first), but I think it wrong to simply decide that
XV does the right thing when it is incompatible with libpnm.

I will look to see if I can find documentation in netpbm which makes
the MSB first clear, but writing the data to be compatible with libpnm
seems the only correct thing to do.

roland
-- 
		       PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@rlenter.com                     76-15 113th Street, Apt 3B
roland@astrofoto.org                       Forest Hills, NY 11375