From d6001f17e28a21967f5b4a978cd5778a47b8eeb6 Mon Sep 17 00:00:00 2001 From: Saeem Mehmood Date: Thu, 5 Dec 2024 02:03:59 +0500 Subject: [PATCH] simple fix for colorhash algo --- imagehash/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagehash/__init__.py b/imagehash/__init__.py index 47e5e7d..c23ab9f 100644 --- a/imagehash/__init__.py +++ b/imagehash/__init__.py @@ -438,7 +438,7 @@ def colorhash(image, binbits=3): maxvalue = 2**binbits values = [min(maxvalue - 1, int(frac_black * maxvalue)), min(maxvalue - 1, int(frac_gray * maxvalue))] for counts in list(h_faint_counts) + list(h_bright_counts): - values.append(min(maxvalue - 1, int(counts * maxvalue * 1. / c))) + values.append(min(maxvalue - 1, int(counts) * maxvalue * 1. / c)) # print(values) bitarray = [] for v in values: