log "Processing $1 to $2"
TMPDIR="$(mktemp -d)"
+trap "rm -r $TMPDIR" EXIT
log "Temp directory created in $TMPDIR"
NUMPAGES=$(identify "$1" | wc -l)
montage -geometry +0+0 $TMPDIR/*.png "$2"
log "Montaging done"
-
-rm -r $TMPDIR
-log "Cleaned up"
-
-log "Done"