[sane-devel] sane_cancel()

René Rebe rene at exactcode.de
Wed Jul 16 11:09:54 UTC 2008


m. allan noah wrote:
> On 7/15/08, Kåre Särs <kare.sars at kolumbus.fi> wrote:
>> Hi again,
>>  On Wednesdayen den 16 July 2008 02:02:36 Kåre Särs wrote:
>>  > Hi,
>>  >
>>  > I'm a bit confused with the use of sane_cancel(). I noticed today that the
>>  > pixma backend requires a sane_cancel after each scan (libksane did not work
>>  > correctly with the pixma backend). I have read here on the list:
>>  > "5. be aware that a proper front-end in batch mode will call
>>  > sane_start() at the beginning of each page, but only call sane_cancel
>>  > after the last page returns SANE_STATUS_NO_DOCS."
>>  >
>>  > Why does the frontend have to call sane_cancel() at the end of a scan?
>>  >
>>  > Is this a bug in the pixma backend (libksane works OK with at least the
>>  > test, epson, epkowa and v4l backends), or is the pixma backend just more
>>  > strict than the backends I have tested with before? (The problem was that
>>  > the backend did not accept writes to any parameters after a scan without a
>>  > cancel at the end.)
>>  >
>>  > I remember reading something about clarifying the use of sane_cancel() in
>>  > the standard for 1.1, but I can't remember what it was about :)
>>  >
>> Reading the standard again I see in 4.4 "Note that sane_cancel() must be
>>  called even if the last read operation returned SANE_STATUS_EOF."
>>  But I'm still wondering why :)
> sane_cancel should be called at the end of the batch, but not between
> pages, otherwise backends which buffer the backside of a duplex read
> will drop the image. this is an unfortunate historical accident,
> because sane_cancel serving a dual purpose worked fine for flatbed
> scanners that had no concept of a 'batch'.
> if pixma backend requires a call to sane_cancel after each page of a
> batch scan, it is broken, and wont work with scanimage -b
> allan

At least the Avision backend requires a cancel for management taks between
each page, likewise. The time I implemented this (like 5 years ago?) 
this was
standard behavior (from what I remember).

So we have to go review this in detail?

  René Rebe - ExactCODE GmbH - Europe, Germany, Berlin
  http://exactcode.de | http://t2-project.org | http://rene.rebe.name

More information about the sane-devel mailing list