image module: update getImageHash method
This commit is contained in:
parent
0ddb32858b
commit
e4e6a2ff3a
1 changed files with 2 additions and 2 deletions
|
@ -41,8 +41,8 @@ def getHSL(rgb):
|
||||||
hsl[1] = (maximum - minimum) / (2 - 2 * hsl[2])
|
hsl[1] = (maximum - minimum) / (2 - 2 * hsl[2])
|
||||||
return tuple(hsl)
|
return tuple(hsl)
|
||||||
|
|
||||||
def getImageHash(image, mode):
|
def getImageHash(image_file, mode):
|
||||||
image = image.resize((8, 8), Image.ANTIALIAS)
|
image = Image.open(image_file).convert('RGB').resize((8, 8), Image.ANTIALIAS)
|
||||||
image_hash = 0
|
image_hash = 0
|
||||||
if mode == 'color':
|
if mode == 'color':
|
||||||
# divide the image into 8 zones:
|
# divide the image into 8 zones:
|
||||||
|
|
Loading…
Reference in a new issue