Commit 4ad9624f authored by Alexandre Boeglin's avatar Alexandre Boeglin

an ERP5 Image's width and height properties are equal to 0 until

_update_image_info() has been called.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13427 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0ee2d852
......@@ -341,7 +341,7 @@ xmlns:config="http://openoffice.org/2001/config" office:version="1.0">
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 @@ class FSOOoTemplate(FSPageTemplate, OOoTemplate):
InitializeClass(FSOOoTemplate)
registerFileExtension('ooot', FSOOoTemplate)
registerMetaType(OOoTemplate.meta_type, FSOOoTemplate)
\ No newline at end of file
registerMetaType(OOoTemplate.meta_type, FSOOoTemplate)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment