Do not fail if size attribute of image is missing

issue6967
review39921002
This commit is contained in:
Cédric Krier committed 2017-11-27 22:00:18 +01:00
1 parent ce6e099fae
commit cdccc2ee96
1 file changed
+4 -4
@@ -533,10 +533,10 @@ class Image(GenericText):
else:
value = field.get_data(record)
pixbuf = data2pixbuf(value)
if (self.attrs.get('width', -1) != -1 or
self.attrs.get('height', -1) != -1):
pixbuf = common.resize_pixbuf(pixbuf,
self.attrs['width'], self.attrs['height'])
width = self.attrs.get('width', -1)
height = self.attrs.get('height', -1)
if width != -1 or height != -1:
pixbuf = common.resize_pixbuf(pixbuf, width, height)
cell.set_property('pixbuf', pixbuf)
def get_textual_value(self, record):