diff --git a/README.md b/README.md index 1bd04f9..c37ad20 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ paper to pdf converter suitable for texts. - [Coming soon](#coming-soon) - [Origin of the name](#origin-of-the-name) - [Troubleshooting](#troubleshooting) + - [Tested on](#tested-on) - [License](#license) [](TOC) @@ -185,6 +186,9 @@ http://www.jpeek.com/articles/linuxmag/2006-08/ - [GNU Parallel](http://www.gnu.org/software/parallel/) - Execute image post processing jobs in parallel +- [GNU stream editor](https://www.gnu.org/software/sed/) + - Remove leading zeros from filenames + - [Netpbm](http://netpbm.sourceforge.net/) - Fix the newly scanned immages by truncating the unnecessary parts. This is mostly useful when scanning from the ADF @@ -227,11 +231,17 @@ This is the error returned by `convert`: convert: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408. +## Tested on + +| Distribution | Scanner Name | `vendor:product` | Connection | +|--------------|--------------|------------------|------------| +| Parabola GNU/Linux-libre | HP Officejet 2620 | `03f0:c911` | USB | + ## License ![https://www.gnu.org/graphics/gplv3-127x51.png](https://www.gnu.org/graphics/gplv3-127x51.png) -Copyright (C) 2017-2018 frnmst (Franco Masotti) +Copyright (C) 2017-2018 frnmst (Franco Masotti) spectrscan is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free diff --git a/fbopt b/fbopt index 82e3bce..1d3c43d 100644 --- a/fbopt +++ b/fbopt @@ -100,6 +100,7 @@ main() local resolution="${RESOLUTION}" local source="${SOURCE}" local unpaper="${UNPAPER}" + local two_sided="${TWO_SIDED}" local program_name="${0}" opts="$(getopt \ diff --git a/spectrscan b/spectrscan index af5ed8a..1f00638 100755 --- a/spectrscan +++ b/spectrscan @@ -4,7 +4,6 @@ # spectrscan # # Copyright (C) 2017-2018 frnmst (Franco Masotti) -# # # This file is part of spectrscan. # @@ -34,12 +33,18 @@ check_software() pdftk \ parallel \ file \ - pamfix + pamfix \ + sed \ + tr \ + sort \ + ls \ + head } get_last_page_side_a() { - ls spectrscan_out*.pnm | sort --reverse | head -n1 | tr -d [a-z]._ + # remove trailing zeros with sed. + ls spectrscan_out*.pnm | tr -d [a-z]._ | sed -e 's/^[0]*//' | sort --reverse --numeric | head -n1 } select_page_parameters() diff --git a/spectrscan.HP_Officejet_2620.conf b/spectrscan.HP_Officejet_2620.conf index 7a48464..357a7b6 100644 --- a/spectrscan.HP_Officejet_2620.conf +++ b/spectrscan.HP_Officejet_2620.conf @@ -1,7 +1,9 @@ TMP_DIR="$(pwd)/.spectrscan-$RANDOM" SRC_DIR="$(pwd)" IMAGEMAGICK='-normalize -level 70%,100%,1.0' +#IMAGEMAGICK='-normalize -level 20%,100%,1.0' MODE='Lineart' RESOLUTION='300' SOURCE='ADF' UNPAPER='false' +TWO_SIDED='false'