diff --git a/gramps/gui/editors/displaytabs/gallerytab.py b/gramps/gui/editors/displaytabs/gallerytab.py index 19e8269a4..7ef1eff19 100644 --- a/gramps/gui/editors/displaytabs/gallerytab.py +++ b/gramps/gui/editors/displaytabs/gallerytab.py @@ -523,13 +523,14 @@ class GalleryTab(ButtonTab, DbGUIElement): d = conv_to_unicode((file.replace('\0',' ').strip()), None) protocol, site, mfile, j, k, l = urlparse(d) if protocol == "file": - mime = get_type(mfile) + name = url2pathname(mfile) + mime = get_type(name) if not is_valid_type(mime): return photo = MediaObject() base_dir = cuni(media_path(self.dbstate.db)) if os.path.exists(base_dir): - name = relative_path(mfile, base_dir) + name = relative_path(name, base_dir) photo.set_path(name) photo.set_mime_type(mime) basename = os.path.basename(name)