blob: 522a42a19cd0e9aade470ffd81a803a84f508e4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/bash
time=$(date +%Y-%m-%d_%H%M%S)
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
|