wiasane
wiasane copied to clipboard
Handling of rounding issues while converting between units of length
The WIA microdriver currently handles those issues by always falling back to the user-supplied values. Those input values are basically set in stone, since most implementations of WIA user-interfaces do not provide a way to get updated/rounded values back from the scanning device. The values are set using a fire-and-forget approach which leads to the receiving part always assuming that the aquired image consists of the originally requested length in bytes.
The current implementation achieves this by trimming of additional padding bytes or filling up missing bytes on a per line and total row basis.
The file sanei_constrain_value.c of the sane-project contains code to apply constraints to a variable.