Fix Lens issue

This commit is contained in:
AuroraWright
2025-04-06 00:55:51 +02:00
parent 6087248071
commit 7568124460
2 changed files with 9 additions and 7 deletions

View File

@@ -288,8 +288,10 @@ class GoogleLens:
response_dict = response_proto.to_dict(betterproto.Casing.SNAKE)
res = ''
text = response_dict['objects_response']['text']['text_layout']['paragraphs']
for paragraph in text:
text = response_dict['objects_response']['text']
if 'text_layout' in text:
paragraphs = text['text_layout']['paragraphs']
for paragraph in paragraphs:
for line in paragraph['lines']:
for word in line['words']:
res += word['plain_text'] + word['text_separator']

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "owocr"
version = "1.13.1"
version = "1.13.2"
description = "Japanese OCR"
readme = "README.md"
requires-python = ">=3.11"