bunchesofdonald/photohash — pull request #1 by yoshpe (2014-01-20 13:13:13+00:00)
Title: Possible bug report: imagehash.average_hash throws an exception on image resize.

Hi,

In the find_similar_images.py example when running on a large set of images I encountered a problem.
Sometimes average_hash throws an exception (Mac OS X 10.9 Python2.7):
```python
hash = hashfunc(Image.open(path))
File "/Library/Python/2.7/site-packages/imagehash/__init__.py", line 97, in average_hash
image = image.convert("L").resize((hash_size, hash_size), Image.ANTIALIAS)
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 710, in convert
self.load()
File "/Library/Python/2.7/site-packages/PIL/ImageFile.py", line 218, in load
raise IOError("image file is truncated (%d bytes not processed)" % len(b))
```

This is similar to http://stackoverflow.com/questions/12984426/python-pil-ioerror-image-file-truncated-with-big-images and might be a result of aspect ratio problem?
I haven't dug deeply enought into the code to understand what is the cause of this.

Thanks!