From e4e6a2ff3a86d5306bef9dc42b1f3806345d753e Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 27 Dec 2012 14:47:15 +0100 Subject: [PATCH] image module: update getImageHash method --- ox/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ox/image.py b/ox/image.py index 568c2b7..26831e5 100644 --- a/ox/image.py +++ b/ox/image.py @@ -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: