changeset 500:de15d700d553

macro.Image._transform: exception handler for transpose_func added
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 17 Feb 2010 13:11:56 +0100
parents 25702a913bdd
children 16aa5b518631
files data/plugin/macro/Image.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/macro/Image.py	Wed Feb 17 04:22:17 2010 +0300
+++ b/data/plugin/macro/Image.py	Wed Feb 17 13:11:56 2010 +0100
@@ -201,7 +201,10 @@
                 7: lambda image: image.transpose(PILImage.ROTATE_90).transpose(PILImage.FLIP_LEFT_RIGHT),
                 8: lambda image: image.transpose(PILImage.ROTATE_90),
             }
-            image = transpose_func[transpose_op](image)
+            try:
+                image = transpose_func[transpose_op](image)
+            except KeyError:
+                pass
 
             buf = StringIO.StringIO()
             image.save(buf, output_type)