[evince] libdocument: return 96 DPI if unable to determine true value



commit fafa2603d553ed3f81e5780cb8f8c16957d505eb
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Sun Sep 10 21:41:48 2017 +0200

    libdocument: return 96 DPI if unable to determine true value
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719400

 libdocument/ev-document-misc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c
index bb1dd1a..a3f239c 100644
--- a/libdocument/ev-document-misc.c
+++ b/libdocument/ev-document-misc.c
@@ -513,9 +513,13 @@ ev_document_misc_get_screen_dpi (GdkScreen *screen)
 
        /*diagonal in pixels*/
        dp = hypot (gdk_screen_get_width (screen), gdk_screen_get_height (screen));
+       if (dp == 0)
+               return 96;
 
        /*diagonal in inches*/
        di = hypot (gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm (screen)) / 25.4;
+       if (di == 0)
+               return 96;
 
        return (dp / di);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]