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

Major A andras at users.sourceforge.net
Sun Sep 21 13:40:54 BST 2003

> 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.

OK, there seems to be a misunderstanding here: the batch option in
scanimage is meant for scanners that support automatic document
feeding. I don't think this is the case with your $40 scanner.

>     i=0
>     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)
>     done

Good idea, but I would only store the pictures inside the loop, you
can crop and convert to jpg later. Clipping and conversion can be done
with "convert" from ImageMagick. I use a slightly different loop when
doing batch scans, but the result is much the same.


Major Andras
    e-mail: andras at users.sourceforge.net
    www:    http://andras.webhop.org/

More information about the sane-devel mailing list