update multi apps

This commit is contained in:
tsuky_chen
2024-03-07 01:24:36 +08:00
parent 69ef653a7c
commit 5b5475094e
8 changed files with 215 additions and 8 deletions

View File

@@ -183,6 +183,16 @@ def compare_docx_images(docx_file1, docx_file2):
return 0
return 1
import pytesseract
def compare_image_text(image_path, rule):
img = Image.open(image_path)
img_text = pytesseract.image_to_string(img)
if rule['type'] == 'text':
return 1 if rule['text'] in img_text else 0
else:
raise ValueError("Unsupported rule type")
def compare_line_spacing(docx_file1, docx_file2):
if not compare_docx_files(docx_file1, docx_file2):
return 0