diff options
Diffstat (limited to 'scan-multi')
-rwxr-xr-x | scan-multi | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |