rcl ocr with tesseract: fix stupid breakage in script

This commit is contained in:
Jean-Francois Dockes 2021-06-13 07:14:51 +01:00
parent e42a4e9669
commit 174ad9fe22

View File

@ -80,11 +80,12 @@ def ocrpossible(config, path):
global tesseractcmd global tesseractcmd
if not tesseractcmd: if not tesseractcmd:
config.setKeyDir(os.path.dirname(path)) config.setKeyDir(os.path.dirname(path))
tesseractcmd = config.getConfParam("tesseractcmd")
if tesseractcmd: if tesseractcmd:
# It is very tempting to quote this value, esp. on Windows where it # It is very tempting to quote this value, esp. on Windows where it
# will contain whitespace. There is no chance that an actual # will contain whitespace. There is no chance that an actual
# command line would have quotes, so unquote it. # command line would have quotes, so unquote it.
tesseractcmd = config.getConfParam("tesseractcmd").strip('"') tesseractcmd = tesseractcmd.strip('"')
else: else:
tesseractcmd = rclexecm.which("tesseract") tesseractcmd = rclexecm.which("tesseract")
if not tesseractcmd: if not tesseractcmd: