diff --git a/README.md b/README.md index 36a021e..e3b7244 100644 --- a/README.md +++ b/README.md @@ -225,12 +225,13 @@ Normal instructions apply once the application starts. ## Windows - Requirements - **Google Tesseract** installed and in path - - A copy of the version 4 is bundled with the release. Just run it, no extra packages needed - - You can download the installer here version here: [Installer here](https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-w64-setup-v4.1.0.20190314.exe) + - A copy of the version 5.0.1 is bundled with the release. Just run it, no extra packages needed + - You can download the installer here version here: [Installer here](https://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-w64-setup-v5.0.1.20220118.exe) - Make sure it's in path - Python3 installed and in path - Running: - `source env/bin/activate` (if you use a virtual env) + - `python main.py` # Extra command-line options If you run from source, or call the executable from the terminal you can make use of the following flags/arguments to achieve different functionality. diff --git a/data/versions.json b/data/versions.json index c49a307..dc6592e 100644 --- a/data/versions.json +++ b/data/versions.json @@ -1,5 +1,5 @@ { - "app": "1.5.2", + "app": "1.5.3", "skills": "3.0", "languages": { "eng": "1.0.1", diff --git a/src/tesseract/tesseract_utils.py b/src/tesseract/tesseract_utils.py index f716303..b7b79f1 100644 --- a/src/tesseract/tesseract_utils.py +++ b/src/tesseract/tesseract_utils.py @@ -25,7 +25,7 @@ def _is_pyinstaller(): def _get_pyinstaller_tesseract_path(): base_path = sys._MEIPASS - bundled_path = os.path.join(base_path, "Tesseract-OCR", "libtesseract-4.dll") + bundled_path = os.path.join(base_path, "Tesseract-OCR", "libtesseract-5.dll") return bundled_path @@ -37,6 +37,7 @@ def find_tesseract(): # TODO: Make this resilient to "change" (tesseract version), probably not necessary locations = [ ctypes.util.find_library("libtesseract-4"), # win32 + ctypes.util.find_library("libtesseract-5"), # win32 ctypes.util.find_library("libtesseract302"), # win32 version 3.2 ctypes.util.find_library("libtesseract"), # others ctypes.util.find_library("tesseract"), # others @@ -44,6 +45,18 @@ def find_tesseract(): if WINDOWS: locations += [ + os.path.join( + os.getenv("ProgramW6432"), "Tesseract-OCR", "libtesseract-5.dll" + ), + os.path.join( + os.getenv("LOCALAPPDATA"), "Tesseract-OCR", "libtesseract-5.dll" + ), + os.path.join( + os.getenv("ProgramFiles"), "Tesseract-OCR", "libtesseract-5.dll" + ), + os.path.join( + os.getenv("programfiles(x86)"), "Tesseract-OCR", "libtesseract-5.dll" + ), os.path.join( os.getenv("ProgramW6432"), "Tesseract-OCR", "libtesseract-4.dll" ),