diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index d0b4daef1..729706a10 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -2690,10 +2690,14 @@ class MediaPage(BasePage): (width, height) = ImgManip.image_size(orig_image_path) max_width = self.report.options['maxinitialimagewidth'] max_height = self.report.options['maxinitialimageheight'] - scale_w = (float(max_width)/width) or 1 # the 'or 1' is so that - # a max of zero is ignored + if width != 0 and height != 0: + scale_w = (float(max_width)/width) or 1 # the 'or 1' is so that + # a max of zero is ignored - scale_h = (float(max_height)/height) or 1 + scale_h = (float(max_height)/height) or 1 + else: + scale_w = 1.0 + scale_h = 1.0 scale = min(scale_w, scale_h, 1.0) new_width = int(width*scale) new_height = int(height*scale)