ocr: compat: make a non-existant ocrprogs config variable equivalent to "tesseract"

This commit is contained in:
Jean-Francois Dockes 2020-02-28 14:38:02 +01:00
parent 0fa0c273ab
commit fe86fa9e1f
2 changed files with 12 additions and 5 deletions

View File

@ -81,9 +81,13 @@ if incache:
# Retrieve configured OCR program names and try to load the
# corresponding module
ocrprogs = config.getConfParam("ocrprogs")
if ocrprogs is None:
# Compat: the previous version has no ocrprogs variable, but would do
# tesseract by default. Use "ocrprogs = " for a really empty list
ocrprogs = "tesseract"
if not ocrprogs:
_deb("No ocrprogs variable in recoll configuration")
sys.exit(1)
sys.exit(0)
#_deb("ocrprogs: %s" % ocrprogs)

View File

@ -905,7 +905,7 @@ snippetMaxPosWalk = 1000000
#
# <brief>Attempt OCR of PDF files with no text content.</brief>
# <descr>This can be defined in subdirectories. The default is off because
# OCR is so very slow. Will only do anything if ocrprogs is defined.</descr>
# OCR is so very slow.</descr>
# </var>
#pdfocr = 0
@ -946,10 +946,13 @@ snippetMaxPosWalk = 1000000
# <brief>OCR modules to try.</brief>
# <descr>The top OCR script will try to load the corresponding modules in
# order and use the first which reports being capable of performing OCR on
# the input file. Modules for tesseract and ABBYY FineReader are present in
# the standard distribution.</descr>
# the input file. Modules for tesseract (tesseract) and ABBYY FineReader
# (abbyy) are present in the standard distribution. For compatibility with
# the previous version, if this is not defined at all, the default value is
# "tesseract". Use an explicit empty value if needed. A value of "abbyy
# tesseract" will try everything.</descr>
# </var>
#ocrprogs = abbyy tesseract
#ocrprogs = tesseract
# <var name="ocrcachedir" type="dfn">
# <brief>Location for caching OCR data.</brief>