Broke my_seq out to its own file (it handles the lack of seq on mac os x and the...
[dja/scandal.git] / scan2pages.sh
index b129963..9c08f6a 100755 (executable)
@@ -22,13 +22,7 @@ __EOF__
 }
 
 ## Setup and utilities ##
-# Mac OS X doesn't have seq. It has jot instead.
-Linux_seq="seq"
-Darwin_seq="jot -"
-if [[ $(uname) == "Darwin" ]]; then my_seq=$Darwin_seq;
-else my_seq=$Linux_seq;
-fi;
-
+source $(dirname $0)/my_seq.sh
 
 ## Process flags ##
 forcepdf=
@@ -162,8 +156,6 @@ for pg in `$my_seq 1 $pages`; do
        
        # check it hasn't mostly disappeared - e.g. if the scan was all black
        # (e.g. forgot to put the book down when you first hit scan)
-       # ... not sure why such a convoluted form is required. expr doesn't like
-       # processing a convert -format "%w * %h" or any variant thereof
        if [[ $(convert  $preppnm -format '%[fx:s.w*s.h>1000]' info:) = "0" ]]; then
                [[ $verbose == 1 ]] && echo "Discarding pg ${pgn}: not enough remains after masking."
                continue; 

UCC git Repository :: git.ucc.asn.au