diff --git a/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py index 9a5a98cbf..77f55cc07 100644 --- a/gramps/plugins/webreport/narrativeweb.py +++ b/gramps/plugins/webreport/narrativeweb.py @@ -2412,7 +2412,10 @@ class BasePage(object): if mime_type: if mime_type.startswith("image/"): real_path, newpath = self.report.prepare_copy_media(media) - newpath = self.report.build_url_fname(newpath) + newpath = self.report.build_url_fname(newpath, up=self.up) + dest_dir = os.path.dirname(self.report.cur_fname) + if dest_dir: + newpath = os.path.join(dest_dir, newpath) self.report.copy_file(media_path_full( self.report.database, media.get_path()), newpath)