diff options
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 |