diff --git a/src/OFS/Image.py b/src/OFS/Image.py index 4e933bf661..86e4b2c124 100644 --- a/src/OFS/Image.py +++ b/src/OFS/Image.py @@ -843,6 +843,8 @@ def getImageInfo(data): except Exception: return content_type, width, height for svg in xmldoc.getElementsByTagName('svg'): + w = width + h = height content_type = 'image/svg+xml' if 'height' in svg.attributes and 'width' in svg.attributes: w = svg.attributes['width'].value @@ -866,8 +868,8 @@ def getImageInfo(data): viewBox = [int(float(x)) for x in viewBox.split(' ')] w = viewBox[2] - viewBox[0] h = viewBox[3] - viewBox[1] - width = int(w) - height = int(h) + width = int(w) + height = int(h) return content_type, width, height