diff --git a/product/ERP5/Document/Image.py b/product/ERP5/Document/Image.py index b572695d92ef644819ff4ee13ce041b643bf6826..c01b0b3e93726b1268f5714664e47bebf6a77f02 100644 --- a/product/ERP5/Document/Image.py +++ b/product/ERP5/Document/Image.py @@ -150,9 +150,9 @@ class Image(TextConvertableMixin, File, OFSImage): self.data = self._data # Make sure size is defined - if (not hasattr(aq_base(self), 'size') or not self.size) and \ - hasattr(aq_base(self), 'data'): - self.size = len(self.data) + size = len(self.data) + if getattr(aq_base(self), 'size', None) != size: + self.size = size security.declareProtected(Permissions.AccessContentsInformation, 'getWidth') def getWidth(self):