Check if an image is a duplicate using MD5 hashing.
(image_bytes, hashes)
| 506 | |
| 507 | |
| 508 | def is_duplicate(image_bytes, hashes): |
| 509 | """Check if an image is a duplicate using MD5 hashing.""" |
| 510 | hash_md5 = hashlib.md5(image_bytes).hexdigest() |
| 511 | if hash_md5 in hashes: |
| 512 | return True |
| 513 | hashes.add(hash_md5) |
| 514 | return False |
| 515 | |
| 516 | |
| 517 | def extract_images_from_pdf(pdf_path, output_folder, min_width=50, min_height=50, entropy_threshold=3.0): |
no outgoing calls
no test coverage detected