image module: update getImageHash method

This commit is contained in:
rolux 2012-12-27 14:47:15 +01:00
parent 0ddb32858b
commit e4e6a2ff3a

View file

@ -41,8 +41,8 @@ def getHSL(rgb):
hsl[1] = (maximum - minimum) / (2 - 2 * hsl[2])
return tuple(hsl)
def getImageHash(image, mode):
image = image.resize((8, 8), Image.ANTIALIAS)
def getImageHash(image_file, mode):
image = Image.open(image_file).convert('RGB').resize((8, 8), Image.ANTIALIAS)
image_hash = 0
if mode == 'color':
# divide the image into 8 zones: