[sane-devel] image lines is -1 according to sane_get_parameters

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Tue Oct 23 00:00:24 UTC 2012

m. allan noah writes:

> That is the backend's indication that it does not know the length of
> the paper. The backend should have some option where you set the
> height of the image you want it to scan. If you do not tell it, it
> tells you that it does not know. I imagine you use an Avision scanner?
> On Mon, Oct 22, 2012 at 7:27 PM, dabicho <tsukebumi at gmail.com> wrote:
>> Hi.
>> I am writing a front-end.
>> In previous version, after sane_start, sane_get_parameters would tell
>> me how much memory I would need to allocate for the image.
>> I am using 1.0.22-5 (from fedora) to support a new scanner, but after
>> sane_get_parameters I am told the image is "-1" lines high.
>> What does that mean? I have not received any error, and xsane works alright.
>> or how sould I go about it as a turn around?
>> any pointer please?

See the API specification for sane_get_parameters():

  Member lines specifies how many scan lines the frame is comprised of.
  If this value is -1, the number of lines is not known a priori and the
  frontend should call sane_read () until it returns a status of

There are situations where you want to scan the whole document but the
device cannot determine in advance how long it is.  Think an ECG for

Hope this helps,
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom

More information about the sane-devel mailing list