wagtail / Willow

A wrapper that combines the functionality of multiple Python image libraries into one API
https://willow.wagtail.org/
BSD 3-Clause "New" or "Revised" License
274 stars 53 forks source link

Handle all exceptions when calling _getexif #37

Closed tomasolander closed 8 years ago

tomasolander commented 8 years ago

_getexif can fail in a large number of ways and throw a variety of exceptions. Gracefully handle all exceptions when calling it.

I ran into this issue when importing a large number of images in Wagtail causing a variety of exceptions being thrown due to slightly malformed images that otherwise displayed and scaled fine. It seems like Pillow's EXIF support still hasn't been worked on to more gracefully handle these issues, so I'd say this is the way to go.

Looking around a little, seems like easy-thumbnails had the same issue: https://github.com/SmileyChris/easy-thumbnails/commit/a67f18e3d1dfd09cd73f77d1ac8aa9c29a00711f

kaedroho commented 8 years ago

Thanks @toumaz!