Bug 295119

Summary: when using automatic document feeder only the first page is saved
Product: [Frameworks and Libraries] libksane Reporter: rob verduijn <rob.verduijn>
Component: generalAssignee: Kåre Särs <kare.sars>
Status: RESOLVED WAITINGFORINFO    
Severity: normal CC: nortexoid
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description rob verduijn 2012-03-01 10:10:52 UTC
Version:           0.7 (using KDE 4.7.4) 
OS:                Linux

Hello I have a brother dcp-7065DN which has a flatbed scanner with an automatic document feeder.

Scanning a single page using the automatic document feeder works fine.
But when I wish to scan multiple pages only the first page is saved.

I tried setting the following options:
Save location : /home/rob
Name format: Image-

Save mode: Save without asking for a filename
skanlite  saves only the first page.

Save mode: Open the save dialog for the first image only.
skanlite still asks for a name and saves only the first page.

Save mode: Open the save dialog for every image.
skanlite asks only for a name once and saves only the first page.





Reproducible: Always

Steps to Reproduce:
start skanlite
place multiple pages in automatic document feeder
select scansource 'automatic document feeder'
select save mode 'save without asking for a filename' (or whatever other one you like since it doesn't make any difference)
scan documents

Actual Results:  
the first page was scanned and saved
I don't know if the other pages are scanned as well since I have no idea how to check that.

Expected Results:  
all pages should be scanned and saved

don't hesitate to ask me for other details if you need them
Comment 1 Kåre Särs 2012-03-05 20:33:29 UTC
Unfortunately I do not have a scanner with ADF.

The reason you do no t get all the pages scanned is probably that the scan source name/string is not recognized by libksane as a ADF. That means that the batch scanning is not activated.

Can you run this command:
scanimage -A -d <device>

Where <device> is the devie Id that you get when runing  scanimage -L.

Then copy paste the output to this bug.

Thanks,
  Kåre
Comment 2 rob verduijn 2012-03-06 05:52:56 UTC
Hi, 
The output from the commands is below.

Rob Verduijn

scanimage -L :
device `brother4:net1;dev0' is a Brother DCP-7065DN FRIENDLY-NAME

scanimage -A -d ' brother4:net1;dev0' :
scanimage: rounded value of br-x from 215.9 to 215.88
scanimage: rounded value of br-y from 355.6 to 355.567

All options specific to device `brother4:net1;dev0':
  Mode:
    --mode Black & White|Gray[Error Diffusion]|True Gray|24bit Color [24bit Color]
        Select the scan mode
    --resolution 100|150|200|300|400|600|1200|2400|4800|9600dpi [200]
        Sets the resolution of the scanned image.
    --source FlatBed|Automatic Document Feeder(left aligned)|Automatic Document Feeder(centrally aligned) [Automatic Document Feeder(left aligned)]
        Selects the scan source (such as a document-feeder).
    --brightness -50..50% (in steps of 1) [inactive]
        Controls the brightness of the acquired image.
    --contrast -50..50% (in steps of 1) [inactive]
        Controls the contrast of the acquired image.
  Geometry:
    -l 0..215.9mm (in steps of 0.0999908) [0]
        Top-left x position of scan area.
    -t 0..355.6mm (in steps of 0.0999908) [0]
        Top-left y position of scan area.
    -x 0..215.9mm (in steps of 0.0999908) [215.88]
        Width of scan-area.
    -y 0..355.6mm (in steps of 0.0999908) [355.567]
        Height of scan-area.
Comment 3 Kåre Särs 2012-03-07 17:20:50 UTC
Thanks,

Are you able to compile and test libksane from git? I think I can fix the problem quite easily, but it needs to be tested.

/Kåre
Comment 4 rob verduijn 2012-03-07 19:23:54 UTC
Hi,

I've looked into the git source from libksane and what is in the libksane.src.rpm, and they are not even remotly alike. Obviously it's a long way from git source to rpm package. Without some serious studying (more likely weeks than days) of the kde ways of packaging or the ways of git compiling I cannot compile it. I'm not completely green with compiling stuff, but I definitely need some help and explanations to compile likksane from git.

Rob
Comment 5 Kåre Särs 2012-03-07 19:51:26 UTC
# Get the latest code
git clone git://anongit.kde.org/libksane

# Compile 
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=debugfull ../libksane
make
sudo make install

The above requires that you have KDE development packages installed. On ubuntu you can install all build dependencies with:
sudo apt-get build-dep libksane

I'm not sure if there is something similar on openSUSE...


The line to change would be ~line 919 in libksane/libksane//ksane_widget_private.cpp
Change :
            if (source == "Automatic Document Feeder") {
to
            if (source.contains("Automatic Document Feeder")) {

Hope this helps

/Kåre
Comment 6 rob verduijn 2012-03-07 21:37:47 UTC
Hi,

In opensuse you can install the kde-development libraries with:
zypper in -t pattern devel_kde
Or check the kde-development pattern in the yast installation gui.

The scanner now scans and saves every page  ( jay :-)

Great work.
Rob
Comment 7 Kåre Särs 2012-03-08 20:39:09 UTC
Git commit 794d8fe54f1b4b4af7f985b618b6dc9a64248866 by Kåre Särs.
Committed on 07/03/2012 at 19:16.
Pushed by sars into branch 'KDE/4.8'.

Be less restrictive about scan source for batch-scan

M  +1    -1    libksane/ksane_widget_private.cpp

http://commits.kde.org/libksane/794d8fe54f1b4b4af7f985b618b6dc9a64248866
Comment 8 Kåre Särs 2012-03-08 20:57:10 UTC
Git commit e5d8f6cb95ecbcc9c45baccc08b1ddb0892fc8d8 by Kåre Särs.
Committed on 07/03/2012 at 19:16.
Pushed by sars into branch 'master'.

Be less restrictive about scan source for batch-scan

M  +1    -1    libksane/ksane_widget_private.cpp

http://commits.kde.org/libksane/e5d8f6cb95ecbcc9c45baccc08b1ddb0892fc8d8
Comment 9 Michael D 2015-09-10 13:34:16 UTC
This isn't working for me in Kubuntu 15.10 using Skanlite 1.1. ADF Simplex just scans the first page, even though all pages are fed through the sheet feeder.
Comment 10 Kåre Särs 2015-09-10 19:00:32 UTC
Michael:

Can you do the same as Rob did in comment 2?
Comment 11 Michael D 2015-09-25 14:32:41 UTC
Hi Kare,

Sorry for the delay. Here is the output of scanimage -A -d 'smfp:net;192.168.6.122'

All options specific to device `smfp:net;192.168.6.122':
    --preview[=(yes|no)] [no] [read-only]
        Request a preview-quality scan
  Image Quality:
    --mode Color - 16 Million Colors|Grayscale - 256 Levels|Black and White - Halftone|Black and White - Line Art [Color - 16 Million Colors]
        Set the color composition mode of the scanned image
    --resolution 75|100|150|200|300|600|1200dpi [300]
        Set the resolution of the scanned image
  Scan Area:
    --doc-source Flatbed|ADF Simplex [ADF Simplex]
        Select source of the document to be scanned
    --page-format Statement|Statement(Rotated)|A5|A5(Rotated)|B5(JIS)|Executive|A4|Letter|Legal|Folio|Custom [Letter]
        Set the paper format of the scanned page
    -l 0..216mm [0]
        Set left position of the scan area
    -t 0..355mm [0]
        Set top position of the scan area
    -x 0..216mm [215]
        Width of scan-area.
    -y 0..355mm [279]
        Height of scan-area.
Comment 12 Kåre Särs 2015-09-27 20:58:26 UTC
Git commit ddc17b08dc3923cf134ec5478a62fc7ff10f8497 by Kåre Särs.
Committed on 27/09/2015 at 20:52.
Pushed by sars into branch 'Applications/15.08'.

Also allow sources containg "ADF" to trigger batch scanning

M  +2    -2    libksane/ksane_widget_private.cpp

http://commits.kde.org/libksane/ddc17b08dc3923cf134ec5478a62fc7ff10f8497
Comment 13 Kåre Särs 2015-09-27 21:08:14 UTC
Git commit 6b436624b3b85ec1de0ebd39012f28376b36bac0 by Kåre Särs.
Committed on 27/09/2015 at 21:05.
Pushed by sars into branch 'frameworks'.

Also allow sources containing "ADF" to trigger batch scanning

M  +2    -2    src/ksane_p.cpp

http://commits.kde.org/libksane/6b436624b3b85ec1de0ebd39012f28376b36bac0