scan_stuff [options]
Options:
+ --simplex single sided
+ --duplex double sided (Default)
+ --mode Scanning mode (Color,Gray,Lineart)
--debug, -d debugging level (Default 0)
--help, -h display this help
--man, -m display manual
=over
+=item B<--simplex>
+
+Single sided documents
+
+=item B<--duplex>
+
+Double sided documents (default)
+
+=item B<--mode>
+
+Scanning mode; passed directly to scanimage. Useful options are
+C<Gray> (Default), C<Color>, and C<Lineart>.
+
=item B<--debug, -d>
Debug verbosity. (Default 0)
=head1 EXAMPLES
-scan_stuff
+ scan_stuff; # repeat as necessary
+ scantailor-cli -l 1 --content-detection=cautious *.tif -o out;
+ make_djvu
=cut
debug => 0,
help => 0,
man => 0,
+ mode => 'Gray'
);
GetOptions(\%options,
+ 'duplex!',
+ 'simplex!',
+ 'mode=s',
'debug|d+','help|h|?','man|m');
pod2usage() if $options{help};
$DEBUG = $options{debug};
my @USAGE_ERRORS;
-# if (1) {
-# push @USAGE_ERRORS,"You must pass something";
-# }
+my $use_duplex = 1;
+if (exists $options{duplex} and exists $options{simplex} and
+ not ($options{duplex} xor $options{simplex})) {
+ push @USAGE_ERRORS,"Conflicting --duplex and --simplex options given";
+}
pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
+if ((exists $options{duplex} and not $options{duplex}) or
+ (exists $options{simplex} and $options{simplex})) {
+ $use_duplex = 0;
+}
+
+
use File::Find;
if (@ARGV) {
$last_num++;
exec('scanimage','-d',$options{device},
- '--source','ADF Duplex','--mode','Gray','--format','tiff',
+ '--source',$use_duplex?'ADF Duplex':'ADF Front','--mode',$options{mode},'--format','tiff',
'--batch=out_'.sprintf('%03d',$last_num).'_%03d.tif');
__END__