From 17f116bd1a594a9c8c222757169360068e443ca4 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Fri, 8 Apr 2011 15:46:33 +0800 Subject: [PATCH] Broke my_seq out to its own file (it handles the lack of seq on mac os x and the lack of jot on linux) --- detect2pages.sh | 3 ++- my_seq.sh | 6 ++++++ scan2pages.sh | 8 +------- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 my_seq.sh diff --git a/detect2pages.sh b/detect2pages.sh index 4b8c189..540b08b 100755 --- a/detect2pages.sh +++ b/detect2pages.sh @@ -2,6 +2,7 @@ #should probably have given up on shell and gone over to python. +source $(dirname $0)/my_seq.sh infile=$1 pg=$2 @@ -12,7 +13,7 @@ dir=$(dirname $infile) convert -blur 10 -gamma 0.00001 -median 1 $infile -resize 1x601\! -gamma 0.3 $dir/strip-${pg}-${subpg}.png #There seems to be a definte bias in my reader scans for things to be in the top part rather than the bottom part -testpoints=`jot - 270 320` +testpoints=`$my_seq 270 320` sum=0 prev=0 diff --git a/my_seq.sh b/my_seq.sh new file mode 100644 index 0000000..400a28f --- /dev/null +++ b/my_seq.sh @@ -0,0 +1,6 @@ +# 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; diff --git a/scan2pages.sh b/scan2pages.sh index 5cacfe6..9c08f6a 100755 --- a/scan2pages.sh +++ b/scan2pages.sh @@ -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= -- 2.20.1