Patches for improved batch scanning in scanimage

Date: Sat Jun 02 2001 - 05:42:58 PDT

  • Next message: Gregory F. March: "Re: New member with questions..."


    Short story:

    Attached are two patches for scanimage and its man page to add in a
    collection of useful command line parameters to ease scanning of documents
    on scanners with ADFs.

    Long story:

    I've been wanting to archive some old papers, documents and proceedings
    that I had lying around getting beat up from being moved from one pile to
    the next. I couldn't bear to drop the docs in the shredder because of that
    "I might need it one day" feeling.

    After much head-banging I finally discovered the way to bring my old but
    barely-used scanner back into service was to get it working under SANE. I
    lucked out and just happen to have one of the supported USB HP scanners.
    (An HP C6270A) As far as HP was concerned, I could just drop dead for
    having so old of a scanner so I'm glad for all of the hard work on the
    part of the SANE team. It has been working like a champ for a week now.

    I ran into some troubles while making digital images of documents with my
    ADF for a couple of reasons. First, the HP will happily scan from the ADF
    until its empty then commence doing bed-scans until scanimage is killed.
    Also, the ADF I have is a tiny 20 page model and most of my docs are in
    the 60-120 page range.

    For some reason it doesn't report a status change when the ADF is empty.
    At least not over a USB connection. The 1.0.4 scanimage included in
    sane-backends-1.0.4, only had a simple --batch mode. My extreme thanks to
    whoever put that in, it worked great, but given the limitations of the HP
    I had, I needed more control over batch scanning.

    I've added three more command line parameters for adjusting the starting
    number of the output files, the increment between them and the number of
    pages to scan. This makes it much easier to do a bulk scan of a document
    that won't fit entirely in your ADF, is double-sided when you have a
    single-sided scanner or you have a scanner that won't stop when the ADF is

    Here's how my new parameters work:

    To scan in a 63 page double-sided report:

     $ scanimage --batch=document-%03d.pnm \
                 --batch-count=32 \

     $ scanimage --batch=document-%03d.pnm \
                 --batch-count=31 \
                 --batch-double \

    Some shuffling of the papers is necessary to have all the odd numbered
    pages face-up for the second scan, but it is much easier to gather
    everything into a single composite tiff if their names already sort in the
    proper order.

    The --batch-double command serves as a shortcut to --batch-increment=2.

    Hope this stuff helps someone. Its very low level but it is about all I


         "Premature optimization is the root of all evil" -Donald Knuth
    Caskey <caskey*> /// TechnoCage Inc.
         Heuer's Law: Any feature is a bug unless it can be turned off.

    Source code, list archive, and docs:
    To unsubscribe: echo unsubscribe sane-devel | mail

    This archive was generated by hypermail 2b29 : Sat Jun 02 2001 - 05:43:25 PDT