From: Daniel Axtens Date: Fri, 8 Apr 2011 13:09:59 +0000 (+0800) Subject: do it properly this time X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=850e3073ddd9b0dea8ecaf97ebc14430ff1c3698;p=dja%2Fscandal.git do it properly this time --- 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