summaryrefslogtreecommitdiffstats
path: root/scan-multi
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-09-13 00:08:33 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-09-13 00:08:33 +0200
commit5b5b338503b82cde42fb8cdd7791abb61b939111 (patch)
tree94b6aa445cc86976346b101d08277ac488cf36d3 /scan-multi
parent8450e9ac59dfb678ae3fc2adca5bb837804710f3 (diff)
downloadbin-5b5b338503b82cde42fb8cdd7791abb61b939111.tar.gz
bin-5b5b338503b82cde42fb8cdd7791abb61b939111.tar.xz
misc changes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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