Tattakashi123 / t

Automatically exported from code.google.com/p/twaindotnet
0 stars 0 forks source link

fix for duplex scan. #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. get scanner with duplex support, forexample epson GT-S50
2. set ScanSettings .UseDuplex=true ; .UseDocumentFeeder = true;
3. try scan - result : only front sides of pages scanned.

following change to TwainDtoNet.DataSource.NegotiateDuplex fix problem:
before change:
                if ((Duplex)cap.GetBasicValue().Int16Value == Duplex.None)
                {
                    Capability.SetCapability(Capabilities.DuplexEnabled, (short)Duplex.OnePass, _applicationId, SourceId);

after change:

                if ((Duplex)cap.GetBasicValue().Int16Value != Duplex.None)
                {
                    Capability.SetCapability(Capabilities.DuplexEnabled, true, _applicationId, SourceId);

Original issue reported on code.google.com by mail4...@gmail.com on 30 Nov 2010 at 6:54

GoogleCodeExporter commented 8 years ago
The code before change works for me as the enum value of Duplex.OnePass is the 
short equivalent of true.  But to keep with the Twain spec and fix mail4ski's 
issue, CAP_DUPLEXENABLED should be a bool value.

Patch w/ fix attached

Original comment by jared.r.knipp@gmail.com on 30 Nov 2010 at 8:32

Attachments: