Skip to content

Commit

Permalink
error in dhash horizontal
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesBuchner committed Sep 2, 2016
1 parent 9777d09 commit 7e6af24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imagehash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def dhash(image, hash_size=8):
@image must be a PIL instance.
"""
image = image.convert("L").resize((hash_size, hash_size + 1), Image.ANTIALIAS)
pixels = numpy.array(image.getdata(), dtype=numpy.float).reshape((hash_size + 1, hash_size))
pixels = numpy.array(image.getdata(), dtype=numpy.float).reshape((hash_size, hash_size + 1))
# compute differences
diff = pixels[:, 1:] > pixels[:, :-1]
return ImageHash(diff)
Expand Down

0 comments on commit 7e6af24

Please sign in to comment.