From 2118386fe67477f1a8b989b14ad320041ed8a879 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 31 Mar 2012 18:22:57 +0200 Subject: scan-multi: fix for >10 pages; enhance contrast; add --pdf Signed-off-by: Florian Pritz --- scan-multi | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scan-multi') diff --git a/scan-multi b/scan-multi index 296bab4..522a42a 100755 --- a/scan-multi +++ b/scan-multi @@ -1,9 +1,16 @@ #!/bin/bash time=$(date +%Y-%m-%d_%H%M%S) -scanimage -b -x 214.98 -y 294.973 -for img in out*.pnm; do - newfile="${time}_$((i++)).jpg" - convert "$img" "$newfile" && rm "$img" +scanimage --resolution 200 -b -x 214.98 -y 294.973 +i=1 +while [[ -e "out$i.pnm" ]]; do + img="out$i.pnm" + newname="$(printf "%s_%03d" "$time" "$i")" + convert "$img" -normalize -quality 95 "$newname.jpg" + mv "$img" "$newname.pnm" + ((i++)) done +if [[ $1 = "--pdf" ]]; then + convert "${time}"_*.jpg -resize 1500x1500 "${time}.pdf" +fi -- cgit v1.2.3-24-g4f1b