From a8cd7febf6ef61f77ab5d73651e5074f6fb26ced Mon Sep 17 00:00:00 2001 From: fritz-hh Date: Sat, 11 Jan 2014 22:15:53 +0100 Subject: [PATCH] remove spurious space in img number Tell the script that "nbImg" is a number, so that leading/trailing spaces are removed --- src/ocrPage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ocrPage.sh b/src/ocrPage.sh index e383b8ab..a7207d79 100755 --- a/src/ocrPage.sh +++ b/src/ocrPage.sh @@ -65,8 +65,8 @@ getImgInfo() { # unfortunately this image can have another orientation than in the pdf... # so we will have to extract it again later using pdftoppm pdfimages -f $page -l $page -j "$FILE_INPUT_PDF" "$curOrigImg" 1>&2 - # count number of extracted images - nbImg=`ls -1 "$curOrigImg"* 2>/dev/null | wc -l` + # count number of extracted images + nbImg=$((`ls -1 "$curOrigImg"* 2>/dev/null | wc -l`)) if [ $nbImg -ne "1" ]; then [ $VERBOSITY -ge $LOG_WARN ] && echo "Page $page: Expecting exactly 1 image covering the whole page (found $nbImg). Cannot compute dpi value." return 2