76 Commits

Author SHA1 Message Date
Raman Gupta
9ed52ab2fa More arithmetic context improvements, corner cases
* Handle truncate pages greater than or equal to the number of
scans.
2021-08-06 17:45:40 -04:00
Raman Gupta
d716cdbe8c Fix the multi-output loop
Resolves #33.

Fixes the arithmetic comparison in the while loop being
incorrect.

Also, handles the situation in which there are more output
files being specified than scans available, in addition
to the already handled reverse situation.
2021-08-06 12:51:29 -04:00
Raman Gupta
f9d329cf27 Merge branch 'issue-30-bc-detection' into master 2021-07-30 12:56:58 -04:00
Raman Gupta
45cf51f9e8 Skip empty page detection if optional bc not available 2021-07-30 12:48:20 -04:00
Raman Gupta
ded351edf4
Merge pull request #31 from p/readme-tips
Add helpful usage tips to the readme
2021-07-30 11:47:58 -04:00
Raman Gupta
e03bdfc7b4
Merge pull request #28 from p/quotes
Fix quotes in the readme to be around the arguments only
2021-07-30 11:47:13 -04:00
Oleg Pudeyev
3d059dd5f6 Add helpful usage tips to the readme 2021-07-30 10:45:25 -04:00
Oleg Pudeyev
fd81fe0a4c Fix quotes in the readme to be around the arguments only 2021-07-30 10:14:41 -04:00
Raman Gupta
c25dcdb8a5
Merge pull request #27 from p/no-shift
Remove erroneous shift call
2021-07-27 21:43:20 -04:00
Raman Gupta
3b2d3cedd4
Merge pull request #26 from p/quote-mode
Quote the --mode argument for printers like Brother DCP-7065DN which use spaces in mode names
2021-07-27 21:42:49 -04:00
Raman Gupta
e001a8affb
Merge pull request #25 from p/value-help
Document "scanadf -L" and "scanadf -d <device> --help" invocations
2021-07-27 21:40:40 -04:00
Oleg Pudeyev
257c740095 Remove erroneous shift call 2021-07-27 20:38:44 -04:00
Oleg Pudeyev
cfce23c271 Quote the --mode argument for printers like Brother DCP-7065DN which use spaces in mode names 2021-07-27 20:38:34 -04:00
Oleg Pudeyev
f35971f404 Document "scanadf -L" and "scanadf -d <device> --help" invocations 2021-07-27 20:01:58 -04:00
Raman Gupta
084f0723b8
Merge pull request #24 from p/mode-warning
Add the warning when neither -m/--mode nor --mode-hw-default are specified
2021-07-27 11:04:15 -04:00
Oleg Pudeyev
c26d0b1bf7 Add the warning when neither -m/--mode nor --mode-hw-default are specified
As discussed in #22
2021-07-27 10:56:17 -04:00
Raman Gupta
9f4eb852a4
Merge pull request #22 from p/no-mode
Add --mode-hw-default option to not set --mode
2021-07-27 10:49:52 -04:00
Oleg Pudeyev
9ef32aef3f add --mode-hw-default option 2021-07-27 10:47:28 -04:00
Oleg Pudeyev
e3cbf1bcbb Omit --mode argument when its value is the empty string 2021-07-27 10:09:07 -04:00
Raman Gupta
7fb8e60954
Merge pull request #21 from p/quote-device
Quote the device argument
2021-07-27 01:11:05 -04:00
Oleg Pudeyev
d7484becbc Quote the device argument.
Without doing so if the device includes a semicolon the following happens:

    % ./scan -x 'brother4:bus7;dev1'
    Scanning...
    scanadf: open of device brother4:bus7 failed: Invalid argument
    ./scan: line 248: dev1: command not found
    Found no scans.
2021-07-26 20:30:17 -04:00
Raman Gupta
d33c8caa71 performance: pnmtops to temp file
For some reason when piping the output of pnmtops directly to ps2pdf,
conversion is very slow (especially for color scans).

When writing to an intermediate temporary file, conversion is fast.

Before:

________________________________________________________
Executed in   19.20 secs   fish           external
  usr time    4.01 secs    0.32 millis    4.01 secs
  sys time   20.63 secs    5.30 millis   20.62 secs

After:

________________________________________________________
Executed in  368.06 millis    fish           external
   usr time  378.06 millis    0.00 millis  378.06 millis
   sys time  100.00 millis    2.79 millis   97.21 millis

An improvement of over 50 times!

This should resolve #19.
v1.2
2021-03-10 22:07:09 -05:00
Raman Gupta
dad716786e Merge branch 'issue-16' into master 2020-11-03 10:08:12 -05:00
Raman Gupta
8e6e27a7b3 README: add optional bc dependency 2020-11-03 10:08:03 -05:00
Raman Gupta
b59999717e Allow disable default page size 2020-11-02 15:21:49 -05:00
Raman Gupta
ed98da9c43 Add units dependency to README
See issue #15
2020-11-02 11:22:33 -05:00
Raman Gupta
33f3f9e2ea README: link to dependencies wiki page v1.1-beta v1.1 2020-08-04 10:02:04 -04:00
Raman Gupta
6b313943bb Use bash built-in tests, additional arg parsing checks 2020-07-30 13:53:17 -04:00
Raman Gupta
e9b606c1a7 README: add link to other software 2020-07-29 22:10:46 -04:00
Raman Gupta
f3a743ac72 Minor logging output improvements 2020-07-29 22:02:38 -04:00
Raman Gupta
982090acf8 More temp file cleanup 2020-07-29 22:02:24 -04:00
Raman Gupta
9b71320fa0 Run image to tiff conversion CPU constrained 2020-07-29 22:01:55 -04:00
Raman Gupta
f1baab604b Fix tmp directory cleanup with verbose
Can't set multiple traps on the same signal -- ensure that when the
verbose option is set, the regular cleanup is done in addition to the
lockfile cleanup.
2020-07-29 22:01:30 -04:00
Raman Gupta
aa93b62873 Merge branch 'issue-12' into master 2020-07-29 18:02:08 -04:00
Raman Gupta
b6ff50a4b0 Specify dpi in image header for tesseract
See https://github.com/tesseract-ocr/tesseract/issues/150
2020-07-29 18:01:20 -04:00
Raman Gupta
30a7be1fd8 Merge branch 'issue-9' into master 2020-07-29 17:17:50 -04:00
Raman Gupta
759f79ae7c Merge branch 'issue-8' into master 2020-07-29 17:17:48 -04:00
Raman Gupta
59abdeafe0 Driver-based crop fixes
* Allow page size and crop to be set
* Add driver-based paper lower edge detection with crop
* Add overscan on page size to allow for cropping larger pages
* Do not default size to Letter if crop is specified
2020-07-29 17:17:22 -04:00
Raman Gupta
3582408e85 Minor stylistic changes 2020-07-29 17:11:40 -04:00
Raman Gupta
d17e23ed44 Support driver option pass-through 2020-07-19 08:18:56 -04:00
Raman Gupta
3c091969d5 Force output file spec 2020-07-15 01:12:34 -04:00
Raman Gupta
24882e4397 Merge branch 'issue-6' into master 2020-04-06 22:29:21 -04:00
Raman Gupta
906ffc983f Test for -verbose flag on pnmtops 2020-04-05 17:13:22 -04:00
Raman Gupta
a2414b66fe Update README again re sem dependency 2020-04-05 16:51:36 -04:00
Raman Gupta
9143a41236 usage: note about truncate after skip empty 2020-04-01 01:38:51 -04:00
Raman Gupta
ae0f18cc5d Update README re sem dependency v1.0 2019-08-09 02:19:10 -04:00
Raman Gupta
b38a37793d Merge branch 'issue-4' into master 2019-08-09 02:16:32 -04:00
Raman Gupta
38102d8086 Constrain per page processing CPU usage 2019-08-08 10:30:45 -04:00
Raman Gupta
681bf005b3
Merge pull request #3 from artjomsimon/master
Parse argument for --language
2019-05-26 22:14:48 -04:00
Artjom Simon
2e17cdad0f Parse argument for --language 2019-05-27 01:47:51 +02:00