flozz / yoga-image-optimizer

A graphical tool to convert and optimize JPEG, PNG and WebP images (based on YOGA)
https://yoga.flozz.org
GNU General Public License v3.0
144 stars 11 forks source link

Exceptions when thumbnailing JPEGs with inalid orientation EXIF tag #29

Closed flozz closed 2 years ago

flozz commented 2 years ago
Traceback (most recent call last):
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 342, in _invoke_callbacks
    callback(self)
  File "/home/fabien/devel/public/yoga-image-optimizer/yoga-image-optimizer.git/yoga_image_optimizer/application.py", line 231, in _thumbnail_callback
    pixbuf = future.result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File ".../yoga_image_optimizer/helpers.py", line 111, in preview_gdk_pixbuf_from_image
    for operation in ORIENTATION_OPERATIONS[orientation]:
KeyError: 0

related issues: #14, https://github.com/wanadev/yoga/issues/38