Skip to content

Commit

Permalink
recognition. 5.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mikahanninen committed Dec 11, 2024
1 parent 6ebc248 commit 719a749
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/recognition/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "Apache-2.0"
Expand Down
7 changes: 6 additions & 1 deletion packages/recognition/src/RPA/recognition/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 719a749

Please sign in to comment.