diff options
-rwxr-xr-x | scan-multi | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -6,11 +6,10 @@ 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" + convert "$img" -normalize -quality 95 "$newname.jpg" && rm "$img" ((i++)) done if [[ $1 = "--pdf" ]]; then - convert "${time}"_*.jpg -resize 1500x1500 "${time}.pdf" + convert "${time}"_*.jpg -resize 1500x1500 "${time}.pdf" && rm "${time}"_*.jpg fi |