From b59999717efbd6a6e4ef108295c2ec6b4d0464ae Mon Sep 17 00:00:00 2001 From: Raman Gupta Date: Mon, 2 Nov 2020 15:21:49 -0500 Subject: [PATCH 1/2] Allow disable default page size --- scan | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scan b/scan index a95d473..821ad56 100755 --- a/scan +++ b/scan @@ -19,6 +19,7 @@ MAXPAGE= TRUNCPAGE=0 HELP=0 SIZE= +DEFAULTSIZE=1 PGHEIGHT= PGHEIGHTIN= PGWIDTH= @@ -62,6 +63,8 @@ while [[ $# > 0 ]]; do -pw|--page-width) shift; PGWIDTH=$1 ;; + --no-default-size) DEFAULTSIZE=0 ;; + --crop) CROP=1 ;; --deskew) DESKEW=1 ;; @@ -117,6 +120,8 @@ if [[ $HELP == 1 ]]; then echo " -xo, --driver-options" echo " Send additional options to the scanner driver e.g." echo " -xo \"--whatever bar --frobnitz baz\"" + echo " --no-default-size" + echo " Disable default page size, useful if driver does not support page size/location arguments" echo " --crop" echo " Crop to contents (driver must support this)" echo " --deskew" @@ -182,8 +187,8 @@ fi PS2PDF_OPTS= -if [[ $CROP != 1 && $SIZE == "" ]]; then - # Default to Letter size, but only if crop is not specified +if [[ $CROP != 1 && $SIZE == "" && $DEFAULTSIZE == 1 ]]; then + # Default to Letter size, but only if crop is not specified and this feature is not disabled SIZE=Letter fi From 8e6e27a7b37bd03d38859510b36a86c9a0d5ba03 Mon Sep 17 00:00:00 2001 From: Raman Gupta Date: Tue, 3 Nov 2020 10:08:03 -0500 Subject: [PATCH 2/2] README: add optional bc dependency --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fde9e55..6d52b78 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Installation](https://github.com/rocketraman/sane-scan-pdf/wiki/Dependencies-Ins * flock (usually provided by util-linux) (for properly ordered verbose logs) * tesseract (to make searchable PDFs) * sem (via gnu-parallels, to constrain resource usage during page processing) +* bc (for whitepage detection percentage calculations) ## Getting Started