[Erp5-report] r13427 - /erp5/trunk/products/ERP5OOo/OOoTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 15 11:56:24 CET 2007


Author: alex
Date: Thu Mar 15 11:56:22 2007
New Revision: 13427

URL: http://svn.erp5.org?rev=13427&view=rev
Log:
an ERP5 Image's width and height properties are equal to 0 until
_update_image_info() has been called.

Modified:
    erp5/trunk/products/ERP5OOo/OOoTemplate.py

Modified: erp5/trunk/products/ERP5OOo/OOoTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/OOoTemplate.py?rev=13427&r1=13426&r2=13427&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/OOoTemplate.py (original)
+++ erp5/trunk/products/ERP5OOo/OOoTemplate.py Thu Mar 15 11:56:22 2007
@@ -341,7 +341,7 @@
 
       try:
         aspect_ratio = float(picture.width) / float(picture.height)
-      except TypeError:
+      except (TypeError, ZeroDivisionError):
         aspect_ratio = float(picture.width()) / float(picture.height())
       # fix a default value and correct the aspect
       if h is None:
@@ -554,4 +554,4 @@
 InitializeClass(FSOOoTemplate)
 
 registerFileExtension('ooot', FSOOoTemplate)
-registerMetaType(OOoTemplate.meta_type, FSOOoTemplate)
+registerMetaType(OOoTemplate.meta_type, FSOOoTemplate)




More information about the Erp5-report mailing list