diff --git a/fourcell.sh b/fourcell.sh index 7cd1e6b..aab6ec1 100644 --- a/fourcell.sh +++ b/fourcell.sh @@ -11,6 +11,16 @@ if [[ "${2}" == "" ]]; then exit 2 fi +if [[ "${3}" == "" ]]; then + echo "Please an output directory for pages" + exit 3 +fi + +if [ ! -d "${3}" ]; then + echo "${3} output directory does not exist" + exit 4 +fi + if [ -f "${2}" ]; then echo "Exporting frames from ${2}..." OUTPUT=$(mktemp -d) @@ -79,9 +89,11 @@ for ((i=0;i<${PAGES};++i)); do bash white_fourcell.sh $DPI "${f4}" "${dest}" args="${args} ${dest}" fi - bash apply_image.sh ~/Desktop/page_$i.tiff "${1}" ${args} + bash apply_image.sh ${3}/page_$i.tiff "${1}" ${args} done +echo "Wrote ${3}/page_$i.tiff" + # x determine dpi # convert frame to white_fourcell