[sane-devel] Xsane notes

Major A andras at users.sourceforge.net
Wed Nov 6 22:17:44 GMT 2002


> >  # XSane settings:
> >  #  resolution_x =  200.0
> >  #  resolution_y =  200.0
> >  #  gamma      = 1.00
> >  #  brightness =  0.0
> >  #  contrast   =  0.0
> >  # XSANE data follows
> >  01696 02222
> >  255
> 
> I Don`t know gqview. The header looks ok.

Please bear in mind that, by convention, integers starting with "0"
followed by another digit are taken to be octal numbers in most
programs. Apparently, gqview simply does a strtol() on the line with
the third parameter set to 0, thus realizing the first number in the
line is octal. It stops when it encounters the "9", which is invalid
in the octal base, the second strtol() then picks up at the
"9". That's why the image size is taken to be 14 (which is 016 in
octal) times 96.

Unless the PNM standard (is there such a thing?) specifies explicitly
that decimal base be used, this is a bug in SANE, whereever it is --
image dimensions must not have leading zeros.

  Andras

===========================================================================
Major Andras
    e-mail: andras at users.sourceforge.net
    www:    http://andras.webhop.org/
===========================================================================



More information about the sane-devel mailing list