{"action":"created","issue":{"url":"https://api.github.com/repos/JohannesBuchner/imagehash/issues/51","repository_url":"https://api.github.com/repos/JohannesBuchner/imagehash","labels_url":"https://api.github.com/repos/JohannesBuchner/imagehash/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/JohannesBuchner/imagehash/issues/51/comments","events_url":"https://api.github.com/repos/JohannesBuchner/imagehash/issues/51/events","html_url":"https://github.com/JohannesBuchner/imagehash/issues/51","id":209298578,"number":51,"title":"_binary_array_to_hex gives wrong value","user":{"login":"djunzu","id":8784122,"avatar_url":"https://avatars2.githubusercontent.com/u/8784122?v=4","gravatar_id":"","url":"https://api.github.com/users/djunzu","html_url":"https://github.com/djunzu","followers_url":"https://api.github.com/users/djunzu/followers","following_url":"https://api.github.com/users/djunzu/following{/other_user}","gists_url":"https://api.github.com/users/djunzu/gists{/gist_id}","starred_url":"https://api.github.com/users/djunzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djunzu/subscriptions","organizations_url":"https://api.github.com/users/djunzu/orgs","repos_url":"https://api.github.com/users/djunzu/repos","events_url":"https://api.github.com/users/djunzu/events{/privacy}","received_events_url":"https://api.github.com/users/djunzu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-02-21T22:53:59Z","updated_at":"2017-10-27T00:18:03Z","closed_at":"2017-02-22T19:17:59Z","author_association":"NONE","body":"Correct me if I am wrong, but `_binary_array_to_hex` gives wrong values.\r\n\r\n```python\r\nPython 2.7.13 (default, Feb 16 2017, 19:11:00) \r\n[GCC 5.3.0] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from PIL import Image\r\n>>> import imagehash\r\n>>> img = Image.open('sample_image.png')\r\n>>> ph = imagehash.phash(img)\r\n>>> bool_array = ph.hash.flatten()\r\n>>> bool_array\r\narray([ True, False, False,  True,  True,  True,  True, False, False,\r\n       False,  True,  True,  True,  True, False, False,  True,  True,\r\n       False, False, False, False, False,  True,  True,  True,  True,\r\n        True, False, False, False, False,  True,  True,  True,  True,\r\n       False, False, False, False,  True,  True, False, False, False,\r\n       False,  True,  True,  True,  True,  True, False, False,  True,\r\n        True,  True,  True,  True, False, False, False, False, False, False], dtype=bool)\r\n>>> bit_array = 1*bool_array\r\n>>> bit_array\r\narray([1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0,\r\n       1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0,\r\n       1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0])\r\n>>> bit_string = ''.join(str(b) for b in bit_array)\r\n>>> bit_string\r\n'1001111000111100110000011111000011110000110000111110011111000000'\r\n>>> int(bit_string, 2)\r\n11402201597170935744L\r\n>>> hex(int(bit_string, 2))\r\n'0x9e3cc1f0f0c3e7c0L' # This is the expected hex value for the given bit array (phash)\r\n>>> str(ph)\r\n'793c830f0fc3e703' # and here is the actual value.\r\n```\r\n\r\nIf I made no mistake, let me know and I will submit a PR.\r\n"},"comment":{"url":"https://api.github.com/repos/JohannesBuchner/imagehash/issues/comments/339836849","html_url":"https://github.com/JohannesBuchner/imagehash/issues/51#issuecomment-339836849","issue_url":"https://api.github.com/repos/JohannesBuchner/imagehash/issues/51","id":339836849,"user":{"login":"JohannesBuchner","id":51015,"avatar_url":"https://avatars2.githubusercontent.com/u/51015?v=4","gravatar_id":"","url":"https://api.github.com/users/JohannesBuchner","html_url":"https://github.com/JohannesBuchner","followers_url":"https://api.github.com/users/JohannesBuchner/followers","following_url":"https://api.github.com/users/JohannesBuchner/following{/other_user}","gists_url":"https://api.github.com/users/JohannesBuchner/gists{/gist_id}","starred_url":"https://api.github.com/users/JohannesBuchner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohannesBuchner/subscriptions","organizations_url":"https://api.github.com/users/JohannesBuchner/orgs","repos_url":"https://api.github.com/users/JohannesBuchner/repos","events_url":"https://api.github.com/users/JohannesBuchner/events{/privacy}","received_events_url":"https://api.github.com/users/JohannesBuchner/received_events","type":"User","site_admin":false},"created_at":"2017-10-27T00:18:03Z","updated_at":"2017-10-27T00:18:03Z","author_association":"OWNER","body":"is this a big-endian vs small-endian thing? "}}
{"actor":{"display_login":"JohannesBuchner"}}