changeset 211:da38f8d6693b

ignore truncated broken images
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 05 Aug 2008 16:26:34 +0200
parents f983d1239a67
children bb2f7c52d1d7
files data/plugin/action/arnica_slides.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/arnica_slides.py	Tue Aug 05 16:21:59 2008 +0200
+++ b/data/plugin/action/arnica_slides.py	Tue Aug 05 16:26:34 2008 +0200
@@ -40,8 +40,12 @@
     # will be recreated by the arnica parser
     image_object = Image.open(file_name)
     os.remove(file_name)
-    image_object.rotate(angle).save(file_name, img_type)
-
+    try:
+        image_object.rotate(angle).save(file_name, img_type)
+    except IOError:
+        # image file is truncated
+        # the broken file is gone at that point
+        return
 
 def html_js(request, counter):
     """ javascript for the slides