[sane-devel] howto Duplex

René Rebe rene at exactcode.de
Mon Feb 13 09:45:18 UTC 2006


Hi,

On Sunday 12 February 2006 23:12, abel deuring wrote:
> Hi Horst, Hi Rene
> 
> Horst Herb wrote:
> > On Sun, 12 Feb 2006 23:58, abel deuring wrote:
> >>The Avision backend should have an option that enables the duplex
> >>functionality. I have no idea what its name is, but you can ask a
> >>Python-Sane device instance, which options are available:
> >
> > It has indeed, and I have no problems setting that property:
> > scanner.source = 'ADF Duplex'
> > I also notice from the scanner lights that it switches into Duplex
> mode too
> > while scanning with that option set
> > What I can't do is retrieve the second image from the scanner -
> only a single
> > page image comes through instead of two
> 
> OK, next guess (Rene, can you as the author of the backend confirm
> this?):

The Avision duplex scanning should work as any other backend,
that is sane_start, sane_read*, sane_start, ... where each even invocation
returns the data for the rear pages. This works very fine here - it is
in production since ages ,-)

> Perhaps the PIL source code file Sane/_sane.c is to blame. The
> function SaneDev_snap expects that sane_start has been called, but
> makes all other calls to the Sane library functions needed to
> retrieve an image (sane_getparameters and sane_read) -- and finally
> calls sane_cancel. This last call should optionally be disabled: I'd
> guess that it "resets" the backend so that "backside data" of a
> duplex scan is discarded.
> 
> If Rene confirms my guess, I can write a patch.

Yes, sane_cancel should not be in the code path of normal image aquiration
and will throw currently retrieved data away.

However I have never used nor looked at the python wrapper ...

Yours,

-- 
René Rebe - Rubensstr. 64 - 12157 Berlin (Europe / Germany)
            http://www.exactcode.de | http://www.t2-project.org
            +49 (0)30  255 897 45



More information about the sane-devel mailing list