From c4453e7bf349fee324ea97fea3ef505074d044b1 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 22 Mar 2023 16:25:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20ocrd=20resources=20for=20o?= =?UTF-8?q?crd=5Ftesserocr=20by=20settting=20TESSDATA=5FPREFIX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wrapper/qurator/ocrd_galley/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wrapper/qurator/ocrd_galley/cli.py b/wrapper/qurator/ocrd_galley/cli.py index f39a518..d3f3fea 100644 --- a/wrapper/qurator/ocrd_galley/cli.py +++ b/wrapper/qurator/ocrd_galley/cli.py @@ -16,6 +16,8 @@ LOG_LEVEL = os.environ.get("LOG_LEVEL", "INFO") XDG_CONFIG_HOME = os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config") XDG_DATA_HOME = os.environ.get("XDG_DATA_HOME", Path.home() / ".local" / "share") +# ocrd_tesserocr +TESSDATA_PREFIX = XDG_DATA_HOME / "ocrd-resources" / "ocrd-tesserocr-recognize" def main(): colorama.init() @@ -51,13 +53,18 @@ def docker_run(argv, docker_image): docker_run_options.extend(["-e", "LOG_LEVEL=%s" % LOG_LEVEL]) docker_run_options.extend(["-e", "_OCRD_COMPLETE"]) + # .config docker_run_options.extend(["-e", "XDG_CONFIG_HOME=%s" % XDG_CONFIG_HOME]) docker_run_options.extend(["--mount", "type=bind,src=%s,target=%s" % (XDG_CONFIG_HOME, XDG_CONFIG_HOME)]) + # .local/share docker_run_options.extend(["-e", "XDG_DATA_HOME=%s" % XDG_DATA_HOME]) docker_run_options.extend(["--mount", "type=bind,src=%s,target=%s" % (XDG_DATA_HOME, XDG_DATA_HOME)]) + # ocrd_tesserocr + docker_run_options.extend(["-e", "TESSDATA_PREFIX=%s" % TESSDATA_PREFIX]) + # JAVA_TOOL_OPTIONS is used for Java proxy settings if os.environ.get("JAVA_TOOL_OPTIONS"): docker_run_options.extend(["-e", "JAVA_TOOL_OPTIONS"])