[sane-devel] pixels_per_line and bytes_per_line

Wittawat Yamwong wy-sane-devel at arcor.de
Tue Apr 25 12:31:26 UTC 2006


The SANE Standard Version 1.04 under 4.3.8 states that

c >= B * n * d/8    for d > 1

"Note that the number of bytes per line can be larger than the minimum
value imposed by the right side of this equation.  A frontend must be
able to properly cope with such "padded" image formats."

If I undersand it correctly, it means:
For these parameters
	B = 1 [channel]
	n = 100 [pixels per line]
	d = 8 [bits per sample]
	c >= 100 [bytes]
a backend is allowed to set bytes_per_line (c) to a value more than or equal 
100. For my scanner (Canon PIXMA MP150) a valid width in grayscale mode must 
be multiple of 12. I set n = 100 and c = 108 so that the backend by itself 
doesn't need to throw the padding bytes away. But the output image from 
"scanimage" is corrupted. It seems to me that the frontend works properly if 
and only if c = B*n*d/8. What should I do in this case?

Wittawat Yamwong
Hannover, Germany

More information about the sane-devel mailing list