[sane-devel] batch scanning with a script...

kevin lyda kevin at ie.suberic.net
Sun Sep 21 12:45:22 BST 2003

i swear there's a question here.  it's about batch scanning, but first i
have to ramble on about why...

i recently bought a packard bell scanner.  yes, i know "packard bell"
is not the stellar brand for quality, but i have a stack of photos from
a post college trip that i'd like to scan in (which was >10 years ago
so i'm not going all that fast on this project obviously).  besides it
was only €40.

ok, i'm on redhat 7.3 so after building the following packages from


i can interact with the scanner.  grumble.  i mean, "yeay!"

now, i tried "scanimage -mode Color -b" but on a flatbed scanner that
scans the same image over and over.  next i tried the same thing w/o
the -b, but that scans the entire bed.  besides, xsane offers a slew of
options on bit depth, limiting the scan area, etc that i can't seem to
set with scanimage.

this is annoying.  see, i have this script in mind.  once i learn the
scanner settings for one photo (there are hundreds) i can automate
the settings and the cropping (you can only limit the scanner in one
direction so you still have to crop the side of the image to limit the
image to photograph).  so i don't want to use xsane - something like
scanimage what i need (and it's actually better that the -b doesn't work).

    while true; do
        itxt=$(printf "%03d" i)
        echo enter picture description, enter . on it's own to end
        [commands to read till ^\.$] > image$itxt.txt
        scanimage --mode color --bits 16 --scan-distance 500 \
                  --other-options-ala-xsane > image$itxt.pnm
        [commands to crop image since all photos are the same and then
         convert the image to a jpeg.]
        i=$(expr $i + 1)

with this script i can just leave a window open and do the scans bit by
bit w/o a lot of work.

so...  do i have to learn libsane to do the scanimage line above or does
such an animal exist?  would modifications to scanimage to increase its
features be accepted if they were generic enough?


kevin at ie.suberic.net                        i wouldn't mind what that says;
http://ie.suberic.net/~kevin/cgi-bin/blog          paper never refused ink.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20030921/2dee161d/attachment.sig>

More information about the sane-devel mailing list