[sane-devel] Xsane notes

Michael Herder crapsite@gmx.net
Thu, 7 Nov 2002 07:53:58 +0100


Major A, Mittwoch, 6. November 2002 23:17:
> > >  # 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.

E.g. "man pgm" states, that width and height are  "formatted as ASCII 
characters in decimal". If some image viewer interprets the width/height as 
an octal number, I think one could call this a bug. 

bb
Michael