diff --git a/product/ERP5/Document/Image.py b/product/ERP5/Document/Image.py index b02f44cebc764e799000a10f6c9f42e258907738..a87f5156797394115cccdcfba5b2aa031b778a72 100644 --- a/product/ERP5/Document/Image.py +++ b/product/ERP5/Document/Image.py @@ -146,7 +146,8 @@ class Image(File, OFSImage): self.data = self._data # Make sure size is defined - if not hasattr(aq_base(self), 'size') or not self.size: + if (not hasattr(aq_base(self), 'size') or not self.size) and \ + hasattr(aq_base(self), 'data'): self.size = len(self.data) security.declareProtected(Permissions.AccessContentsInformation, 'getWidth')