From be0239d255d12e3e2311e5bde09a25f6e6193838 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Sun, 15 Dec 2013 15:06:17 +0200 Subject: [PATCH] 7288/7290: port image_dpi legacy gtk code to gtk3 --- gramps/gen/utils/image.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gramps/gen/utils/image.py b/gramps/gen/utils/image.py index 4f3e2af01..135992162 100644 --- a/gramps/gen/utils/image.py +++ b/gramps/gen/utils/image.py @@ -136,10 +136,11 @@ def image_dpi(source): except (AttributeError, KeyError): pass try: - import gtk + from gi.repository import Gdk + s = Gdk.Display.get_default().get_default_screen() dpi = ( - gtk.gdk.screen_width() * MM_PER_INCH / gtk.gdk.screen_width_mm(), - gtk.gdk.screen_height() * MM_PER_INCH / gtk.gdk.screen_height_mm() + s.get_width() * MM_PER_INCH / s.get_width_mm(), + s.get_height() * MM_PER_INCH / s.get_height_mm() ) except: dpi = (96.0,96.0) #LibOO 3.6 assumes this if image contains no DPI info