update multi apps
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user