summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscan-multi5
1 files changed, 2 insertions, 3 deletions
diff --git a/scan-multi b/scan-multi
index 522a42a..44b580c 100755
--- a/scan-multi
+++ b/scan-multi
@@ -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