From 40ea9bf598e586f430db71fc87841184cfafc929 Mon Sep 17 00:00:00 2001 From: Martin Kretzschmar Date: Fri, 21 Jan 2005 00:58:12 +0000 Subject: [PATCH] (pixbuf_document_thumbnails_get_dimensions): force floating point division to calculate page_ratio. Fixes crash with landscape format pixbufs. --- ChangeLog | 7 +++++++ pixbuf/pixbuf-document.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1c2218fe..3c6dd895 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-01-21 Martin Kretzschmar + + * pixbuf/pixbuf-document.c + (pixbuf_document_thumbnails_get_dimensions): force floating point + division to calculate page_ratio. Fixes crash with landscape + format pixbufs. + Thu Jan 20 18:56:35 2005 Jonathan Blandford * shell/ev-view.c (ev_view_realize): make the bg color darker. diff --git a/pixbuf/pixbuf-document.c b/pixbuf/pixbuf-document.c index cdf13100..65cef929 100644 --- a/pixbuf/pixbuf-document.c +++ b/pixbuf/pixbuf-document.c @@ -287,7 +287,7 @@ pixbuf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document, PixbufDocument *pixbuf_document = PIXBUF_DOCUMENT (document); gdouble page_ratio; - page_ratio = gdk_pixbuf_get_height (pixbuf_document->pixbuf) / + page_ratio = ((double)gdk_pixbuf_get_height (pixbuf_document->pixbuf)) / gdk_pixbuf_get_width (pixbuf_document->pixbuf); *width = suggested_width; *height = (gint) (suggested_width * page_ratio); -- 2.43.5