summaryrefslogtreecommitdiffstats
path: root/scan-multi
diff options
context:
space:
mode:
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