summaryrefslogtreecommitdiffstats
path: root/scan-multi
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-03-31 18:22:57 +0200
committerFlorian Pritz <bluewind@xinu.at>2012-03-31 18:22:57 +0200
commit2118386fe67477f1a8b989b14ad320041ed8a879 (patch)
treecc04beec794f22ef39351ad0655ffcc31c7b9f58 /scan-multi
parenteab96a512e587e2bb55e2cad7cd1faa058f100c9 (diff)
downloadbin-2118386fe67477f1a8b989b14ad320041ed8a879.tar.gz
bin-2118386fe67477f1a8b989b14ad320041ed8a879.tar.xz
scan-multi: fix for >10 pages; enhance contrast; add --pdf
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'scan-multi')
-rwxr-xr-xscan-multi15
1 files changed, 11 insertions, 4 deletions
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