From e40b727a573f165d13076fe2695e86182477325e Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Sat, 13 May 2023 10:23:25 +0200 Subject: [PATCH] Narrative web: problem with small pictures. Fixes #012884 --- gramps/plugins/webreport/media.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/webreport/media.py b/gramps/plugins/webreport/media.py index 3672cfbe2..4f671d57a 100644 --- a/gramps/plugins/webreport/media.py +++ b/gramps/plugins/webreport/media.py @@ -472,7 +472,13 @@ class MediaPages(BasePage): if orig_image_path != newpath: url = self.report.build_url_fname( newpath, None, self.uplink) - s_width = 'width: %dpx;' % max_width + regions = self.media_ref_rect_regions(media_handle) + if regions: + s_width = 'width: %dpx;' % max_width + elif width < max_width: + s_width = 'width: %dpx;' % width + else: + s_width = 'width: %dpx;' % max_width mediadisplay += Html("a", href=url) + ( Html("img", src=url, style=s_width,