[evince/gnome-2-26] [pdf] Fix double to int conversion in thumbnails_get_dimensions



commit 65c18446fa8ccf0b2f0729af7e49fa7a4a7ec077
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Wed May 20 20:20:30 2009 +0200

    [pdf] Fix double to int conversion in thumbnails_get_dimensions
    
    Fixes bgo#581524.
---
 backend/pdf/ev-poppler.cc |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index 03fb4a5..72beef9 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -1362,9 +1362,9 @@ pdf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document_thumbnail
 	poppler_page_get_size (POPPLER_PAGE (rc->page->backend_page),
 			       &page_width, &page_height);
 	
-	*width = (gint) MAX (page_width * rc->scale, 1);
-	*height = (gint) MAX (page_height * rc->scale, 1);
-	
+	*width = MAX ((gint)(page_width * rc->scale + 0.5), 1);
+	*height = MAX ((gint)(page_height * rc->scale + 0.5), 1);
+
 	if (rc->rotation == 90 || rc->rotation == 270) {
 		gint  temp;
 



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