From 719a74991a618daac6a70f103b018f39a8c54838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20H=C3=A4nninen?= Date: Wed, 11 Dec 2024 20:35:17 +0200 Subject: [PATCH] recognition. 5.3.7 --- packages/recognition/pyproject.toml | 2 +- packages/recognition/src/RPA/recognition/ocr.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/recognition/pyproject.toml b/packages/recognition/pyproject.toml index 5ebb7f64ad..2ad68d6170 100644 --- a/packages/recognition/pyproject.toml +++ b/packages/recognition/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "rpaframework-recognition" -version = "5.2.6" +version = "5.2.7" description = "OCR capabilities used by RPA Framework" authors = ["RPA Framework "] license = "Apache-2.0" diff --git a/packages/recognition/src/RPA/recognition/ocr.py b/packages/recognition/src/RPA/recognition/ocr.py index fabee1ffa5..1f5130a91d 100644 --- a/packages/recognition/src/RPA/recognition/ocr.py +++ b/packages/recognition/src/RPA/recognition/ocr.py @@ -76,9 +76,14 @@ def find( region = geometry.to_region(region) image = image.crop(region.as_tuple()) + params = {} + if language: + params["lang"] = language + if configuration: + params["config"] = configuration try: data = pytesseract.image_to_data( - image, lang=language, config=configuration, output_type=pytesseract.Output.DICT + image, **params, output_type=pytesseract.Output.DICT ) except TesseractNotFoundError as err: raise EnvironmentError(INSTALL_PROMPT) from err