Skip to content

Commit b72f5ff

Browse files
authored
type-checker
1 parent a3e42d6 commit b72f5ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cleanvision/issue_managers/duplicate_issue_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ def get_hash(image: Image.Image, params: Dict[str, Any]) -> str:
2020
if hash_type == "md5":
2121
pixels = np.asarray(image)
2222
return hashlib.md5(pixels.tobytes()).hexdigest()
23-
elif hash_type == "whash":
23+
24+
if not isinstance(hash_size, int):
25+
raise ValueError("hash_size must be declared as a int in params")
26+
if hash_type == "whash":
2427
return str(imagehash.whash(image, hash_size=hash_size))
2528
elif hash_type == "phash":
2629
return str(imagehash.phash(image, hash_size=hash_size))

0 commit comments

Comments
 (0)