From 850e3073ddd9b0dea8ecaf97ebc14430ff1c3698 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Fri, 8 Apr 2011 21:09:59 +0800 Subject: [PATCH] do it properly this time --- scan2pages.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scan2pages.sh b/scan2pages.sh index 6d232f5..ff8db05 100755 --- a/scan2pages.sh +++ b/scan2pages.sh @@ -132,7 +132,7 @@ for pg in `$my_seq 1 $pages`; do # convert from pdf origfile=$dir/pg-${pgn}.png - if [ ! -e $origpnm ] || [[ $forcepdf ]]; then + if [ ! -e $origfile ] || [[ $forcepdf ]]; then convert $convertflags -depth $depth -density $dpi $file[$(expr $pg - 1)] \ $origfile || exit 1 fi; @@ -149,9 +149,9 @@ for pg in `$my_seq 1 $pages`; do cropcords=$(convert -border 1x1 -bordercolor '#000' -resize 1000% -trim -fuzz 90% -format "%wx%h%O" $dir/pg-mask-${pgn}.png info: || exit 1) # ... crop and despeckle? the final pre-prepared image - convert $convertflags -crop $cropcords $origpnm $preppnm || exit 1 + convert $convertflags -crop $cropcords $origfile $preppnm || exit 1 elif [[ $skipmask ]]; then - cp $origpnm $preppnm + cp $origfile $preppnm fi; # check it hasn't mostly disappeared - e.g. if the scan was all black -- 2.20.1