fix rclocrtesseract fix

This commit is contained in:
Jean-Francois Dockes 2020-09-28 11:05:12 +02:00
parent 8accec9b88
commit 96104e7d67

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))
# It is very tempting to quote this value, esp. on Windows where it if tesseractcmd:
# will contain whitespace. There is no chance that an actual command # It is very tempting to quote this value, esp. on Windows where it
# line would have quotes, so unquote it. # will contain whitespace. There is no chance that an actual
tesseractcmd = config.getConfParam("tesseractcmd").strip('"') # command line would have quotes, so unquote it.
if not tesseractcmd: tesseractcmd = config.getConfParam("tesseractcmd").strip('"')
else:
tesseractcmd = rclexecm.which("tesseract") tesseractcmd = rclexecm.which("tesseract")
if not tesseractcmd: if not tesseractcmd:
_deb("tesseractcmd not found") _deb("tesseractcmd not found")