JohannesBuchner/imagehash — pull request #3 by svisser (2014-04-04 10:46:09+00:00)
Title: Fixed issue where comparison with None fails

Comparison with `None` fails as `__eq__` expects `other` to be a `ImageHash` instance. Example:

```
>>> d = imagehash.dhash(pil_image)
>>> d == None
Traceback (most recent call last):
File "", line 1, in
File "/path/to/project/imagehash/__init__.py", line 68, in __eq__
return numpy.array_equal(self.hash, other.hash)
AttributeError: 'NoneType' object has no attribute 'hash'
```

This commit fixes that for `__eq__`, `__ne__` and `__sub__`.