From 5b5b338503b82cde42fb8cdd7791abb61b939111 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 13 Sep 2014 00:08:33 +0200 Subject: misc changes Signed-off-by: Florian Pritz --- scan-multi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scan-multi') 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 -- cgit v1.2.3-24-g4f1b