diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index 708e8ffae..6eb6f6ef4 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -152,10 +152,14 @@ class GeoGraphyView(OsmGps, NavigationView): self.geo_mainmap = None path = os.path.join(IMAGE_DIR, "48x48", ('gramps-geo-mainmap' + '.png' )) - self.geo_mainmap = cairo.ImageSurface.create_from_png(path) + with open(path, 'rb') as fh: # this is to avoid bug with cairo 1.8.8 + self.geo_mainmap = cairo.ImageSurface.create_from_png(fh) + #self.geo_mainmap = cairo.ImageSurface.create_from_png(path) path = os.path.join(IMAGE_DIR, "48x48", ('gramps-geo-altmap' + '.png' )) - self.geo_altmap = cairo.ImageSurface.create_from_png(path) + with open(path, 'rb') as fh: # this is to avoid bug with cairo 1.8.8 + self.geo_altmap = cairo.ImageSurface.create_from_png(fh) + #self.geo_altmap = cairo.ImageSurface.create_from_png(path) if ( config.get('geography.map_service') in ( constants.OPENSTREETMAP, constants.MAPS_FOR_FREE, @@ -171,7 +175,9 @@ class GeoGraphyView(OsmGps, NavigationView): EventType.MARRIAGE ): path = os.path.join(IMAGE_DIR, "48x48", (constants.ICONS.get(int(ident), default_image) + '.png' )) - self.geo_othermap[ident] = cairo.ImageSurface.create_from_png(path) + with open(path, 'rb') as fh: # this is to avoid bug with cairo 1.8.8 + self.geo_othermap[ident] = cairo.ImageSurface.create_from_png(fh) + #self.geo_othermap[ident] = cairo.ImageSurface.create_from_png(path) def add_bookmark(self, menu, handle): if handle: