[sane-devel] PATCH: Call script per output file from scanimage in batch mode

Simon Matter simon.matter at invoca.ch
Mon Aug 23 12:48:13 UTC 2010


Hi,

I've just came across a problem where I needed to run scanimage for ADF in
batch mode but wanted to call a script for each page that was scanned.
I know that scanadf provides such functionality but we are using scanimage
for everything and I don't want to change that.

The proposed solution simply ads a --batch-script option which will be
called just before the output file is renamed from its temporary filename
"*.part" to the final name. Every non-zero exit status from the script is
treated as an error. The script itself is called with two args, 1 being
the output file name of the temporary file just written, and 2 being the
page number.

May I ask the SANE developers to review it and and commit to SCM if it
looks ok?

Attached patch is against latest stable 1.0.21 but it applies also to
current git.

Thanks,
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sane-backends-1.0.21-scanimage-batch-script.patch.gz
Type: application/x-gzip
Size: 1736 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20100823/e556e3d2/attachment.bin>


More information about the sane-devel mailing list