Author: duncan
Date: Sat Jan  6 10:57:19 2007
New Revision: 8938

Modified:
   branches/rel-1/freevo/src/util/fileops.py

Log:
[ 1629298 ] IMLib2 error when caching webserver thumbnails
Now catching IO errors from image.open


Modified: branches/rel-1/freevo/src/util/fileops.py
==============================================================================
--- branches/rel-1/freevo/src/util/fileops.py   (original)
+++ branches/rel-1/freevo/src/util/fileops.py   Sat Jan  6 10:57:19 2007
@@ -596,9 +596,13 @@
     '''creates a webserver thumbnail image and returns its size.
     '''
     thumb_path = cache_www_thumbnail_path(filename)
-    image = imlib2.open(filename)
-    thumb = image.scale_preserve_aspect(config.WWW_IMAGE_THUMBNAIL_SIZE)
-    thumb.save(thumb_path)
+    try:
+        image = imlib2.open(filename)
+        thumb = image.scale_preserve_aspect(config.WWW_IMAGE_THUMBNAIL_SIZE)
+        thumb.save(thumb_path)
+    except IOError, e:
+        print e
+        return (0, 0)
     return thumb.size
 
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to