From: Martin Kretzschmar Date: Fri, 21 Jan 2005 00:58:12 +0000 (+0000) Subject: (pixbuf_document_thumbnails_get_dimensions): force floating point X-Git-Tag: EVINCE_0_1_1~21 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=40ea9bf598e586f430db71fc87841184cfafc929;p=evince.git (pixbuf_document_thumbnails_get_dimensions): force floating point division to calculate page_ratio. Fixes crash with landscape format pixbufs. --- 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);