From 5924c65b39d1745cc7162d260356a4e037bb1a43 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Sat, 4 Mar 2023 18:51:22 -0500 Subject: [PATCH] Write pages to directory --- fourcell.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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