Invalid Image detection.

main
Robert 8 months ago
parent d74678aec9
commit ff73d74851
  1. 6
      dedup.py
  2. 1
      junk.jpg

@ -370,7 +370,7 @@ def get_image_dimensions_cv(img):
if img is not None:
height, width = img.shape[:2]
return width, height
return None
return None, None
"""
xxhash is about 510x faster than SHA256, non-cryptographic.
@ -414,6 +414,10 @@ if __name__ == "__main__":
w, h = get_image_dimensions_cv(large_img1)
w2, h2 = get_image_dimensions_cv(large_img2)
if w == None or w2 == None or h == None or h2 == None:
print("Aborting...Invalid Image!")
timer()
exit(8)
if w != w2 and w != h2:
print("Diffent Resolutions")
timer()

@ -0,0 +1 @@
njxczsfjsdfjhklfdsklfsdfklsdlfjkdsljfldsfklsdaf
Loading…
Cancel
Save