diff core/image.py @ 839:36d988b800c2

Issue #74, fix bug in 234726f.
author Brian Neal <bgneal@gmail.com>
date Sat, 04 Oct 2014 17:06:56 -0500
parents 234726f5a47a
children 24fc302f9076
line wrap: on
line diff
--- a/core/image.py	Sat Oct 04 16:40:17 2014 -0500
+++ b/core/image.py	Sat Oct 04 17:06:56 2014 -0500
@@ -104,6 +104,9 @@
     if hasattr(im, '_getexif'):
         exif = im._getexif()
         if exif and ORIENT_TAG in exif:
-            return (True, ORIENT_FUNCS[ORIENT_TAG](im))
+            orientation = exif[ORIENT_TAG]
+            func = ORIENT_FUNCS.get(orientation)
+            if func:
+                return (True, func(im))
 
     return (False, im)