diff --git a/src/ocrPage.sh b/src/ocrPage.sh index 35aeecab..e8e50ec7 100644 --- a/src/ocrPage.sh +++ b/src/ocrPage.sh @@ -43,7 +43,7 @@ FORCE_OCR="${14}" # Force to OCR, even if the page already contains fonts # - 2: in case the page contains more than one image # - 3: in case the x,y resolutions are not equal ################################## -imageCharacteristics() { +getImgInfo() { local page widthPDF heightPDF curImgCharacteristics nbImg curImg propCurImg widthCurImg heightCurImg colorspaceCurImg tmpval dpi_x dpi_y epsilon dpi # page number @@ -126,16 +126,16 @@ widthPDF=`echo $PAGE_INFO | cut -f2 -d" "` heightPDF=`echo $PAGE_INFO | cut -f3 -d" "` # create the name of the required temporary files -curOrigImg="$TMP_FLD/${page}.orig-img" # original image available in the current PDF page - # (the image file may have a different orientation than in the pdf file) -curHocr="$TMP_FLD/${page}.hocr" # hocr file to be generated by the OCR SW for the current page -curOCRedPDF="$TMP_FLD/${page}.ocred.pdf" # PDF file containing the image + the OCRed text for the current page -curOCRedPDFDebug="$TMP_FLD/${page}.ocred-debug.pdf" # PDF file containing data required to find out if OCR worked correctly +curOrigImg="$TMP_FLD/${page}.orig-img" # original image available in the current PDF page + # (the image file may have a different orientation than in the pdf file) +curHocr="$TMP_FLD/${page}.hocr" # hocr file to be generated by the OCR SW for the current page +curOCRedPDF="$TMP_FLD/${page}.ocred.pdf" # PDF file containing the image + the OCRed text for the current page +curOCRedPDFDebug="$TMP_FLD/${page}.ocred-debug.pdf" # PDF file containing data required to find out if OCR worked correctly curImgCharacteristics="$TMP_FLD/${page}.orig-img-info.txt" # Detected characteristics of the embedded image # auto-detect the characteristics of the embedded image -imageCharacteristics "$page" "$widthPDF" "$heightPDF" "$curImgCharacteristics" +getImgInfo "$page" "$widthPDF" "$heightPDF" "$curImgCharacteristics" ret_code="$?" # in case the page contains text do not OCR, unless the FORCE_OCR flag is set if [ "$ret_code" -eq "1" -a "$FORCE_OCR" -eq "0" ]; then