diff --git a/src/gui/editors/displaytabs/gallerytab.py b/src/gui/editors/displaytabs/gallerytab.py index 4f17a0f0d..2dd2628b4 100644 --- a/src/gui/editors/displaytabs/gallerytab.py +++ b/src/gui/editors/displaytabs/gallerytab.py @@ -472,6 +472,9 @@ class GalleryTab(ButtonTab, DbGUIElement): if not gen.mime.is_valid_type(mime): return photo = gen.lib.MediaObject() + base_dir = unicode(Utils.media_path(self.dbstate.db)) + if os.path.exists(base_dir): + name = Utils.relative_path(name, base_dir) photo.set_path(name) photo.set_mime_type(mime) basename = os.path.basename(name) diff --git a/src/plugins/view/mediaview.py b/src/plugins/view/mediaview.py index 64b72d9f7..a4ab879e3 100644 --- a/src/plugins/view/mediaview.py +++ b/src/plugins/view/mediaview.py @@ -188,6 +188,9 @@ class MediaView(ListView): if not gen.mime.is_valid_type(mime): return photo = gen.lib.MediaObject() + base_dir = unicode(Utils.media_path(self.dbstate.db)) + if os.path.exists(base_dir): + name = Utils.relative_path(name, base_dir) photo.set_path(name) photo.set_mime_type(mime) basename = os.path.basename(name)