summaryrefslogtreecommitdiffstats
path: root/scan-multi
diff options
context:
space:
mode:
Diffstat (limited to 'scan-multi')
-rwxr-xr-xscan-multi9
1 files changed, 6 insertions, 3 deletions
diff --git a/scan-multi b/scan-multi
index 7c9cb7f..fc6ca33 100755
--- a/scan-multi
+++ b/scan-multi
@@ -1,15 +1,18 @@
#!/bin/bash
+jpeg_quality=70
+jpeg_size=1500x1500
+
time=$(date +%Y-%m-%d_%H%M%S)
-scanimage --resolution 200 -b -x 214.98 -y 294.973
+scanimage --resolution 200 -b -x 215 -y 297
i=1
while [[ -e "out$i.pnm" ]]; do
img="out$i.pnm"
newname="$(printf "%s_%03d" "$time" "$i")"
- convert "$img" -normalize -quality 70 "$newname.jpg" && rm "$img"
+ convert "$img" -normalize -resize $jpeg_size -quality $jpeg_quality "$newname.jpg" && rm "$img"
((i++))
done
if [[ $1 = "--pdf" ]]; then
- convert "${time}"_*.jpg -resize 1500x1500 "${time}.pdf" && rm "${time}"_*.jpg
+ convert "${time}"_*.jpg -resize $jpeg_size -compress jpeg -quality $jpeg_quality -density 72x72 -repage 595x842 "${time}.pdf" && rm "${time}"_*.jpg
fi