From d6ea0793b8434c6a879f22b1ce506ac47a65eba5 Mon Sep 17 00:00:00 2001 From: Jim Barlow Date: Wed, 8 Jan 2014 23:47:21 -0800 Subject: [PATCH 1/2] Fix ocrPage.sh pdftoppm error on OS X 10.9 --- src/ocrPage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/ocrPage.sh diff --git a/src/ocrPage.sh b/src/ocrPage.sh old mode 100644 new mode 100755 index 1a023e05..a3fa9bb5 --- a/src/ocrPage.sh +++ b/src/ocrPage.sh @@ -150,7 +150,7 @@ curImgPixmapClean="$TMP_FLD/$page.cleaned.$ext" # extract current page as image with correct orientation and resolution [ $VERBOSITY -ge $LOG_DEBUG ] && echo "Page $page: Extracting image as $ext file (${dpi} dpi)" -! pdftoppm -f $page -l $page -r $dpi $opt "$FILE_INPUT_PDF" > "$curImgPixmap" \ +! pdftoppm -f $page -l $page -r $dpi $opt "$FILE_INPUT_PDF" - > "$curImgPixmap" \ && echo "Could not extract page $page as $ext from \"$FILE_INPUT_PDF\". Exiting..." && exit $EXIT_OTHER_ERROR # if requested deskew image (without changing its size in pixel) @@ -209,4 +209,4 @@ if [ $KEEP_TMP -eq 0 ]; then rm -f "$curImgInfo" fi -exit 0 \ No newline at end of file +exit 0 From 24a84d63803adb1b46ee7b252ed7e66cbc9683ae Mon Sep 17 00:00:00 2001 From: Jim Barlow Date: Thu, 9 Jan 2014 16:44:24 -0800 Subject: [PATCH 2/2] Fix pdffonts error when filename contains a space --- src/ocrPage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ocrPage.sh b/src/ocrPage.sh index a3fa9bb5..8bfa866d 100755 --- a/src/ocrPage.sh +++ b/src/ocrPage.sh @@ -58,7 +58,7 @@ getImgInfo() { # check if the page already contains fonts (which should not be the case for PDF based on scanned files - [ `pdffonts -f $page -l $page ${FILE_INPUT_PDF} | wc -l` -gt 2 ] && echo "Page $page: Page already contains font data !!!" && return 1 + [ `pdffonts -f $page -l $page "${FILE_INPUT_PDF}" | wc -l` -gt 2 ] && echo "Page $page: Page already contains font data !!!" && return 1 # extract raw image from pdf file to compute resolution