diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-03-31 18:22:57 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-03-31 18:22:57 +0200 |
commit | 2118386fe67477f1a8b989b14ad320041ed8a879 (patch) | |
tree | cc04beec794f22ef39351ad0655ffcc31c7b9f58 /scan-multi | |
parent | eab96a512e587e2bb55e2cad7cd1faa058f100c9 (diff) | |
download | bin-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-x | scan-multi | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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 |