]> www.fi.muni.cz Git - evince.git/commitdiff
Fix thumbnails rotation in pdf documents that include embedded thumbnails.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Fri, 17 Aug 2007 20:11:32 +0000 (20:11 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Fri, 17 Aug 2007 20:11:32 +0000 (20:11 +0000)
2007-08-17  Carlos Garcia Campos  <carlosgc@gnome.org>
* backend/pdf/ev-poppler.cc:
(pdf_document_thumbnails_get_thumbnail):
Fix thumbnails rotation in pdf documents that include embedded
thumbnails.

svn path=/trunk/; revision=2629

ChangeLog
backend/pdf/ev-poppler.cc

index 244d7097cefb1b8bbe43843b7a8dcab9ca734a77..991e3330a3716dd8448e306398ccd0c4fb7174cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-08-17  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * backend/pdf/ev-poppler.cc:
+       (pdf_document_thumbnails_get_thumbnail):
+
+       Fix thumbnails rotation in pdf documents that include embedded 
+       thumbnails.
+       
 2007-08-15  Jens Granseuer  <jensgr@gmx.net>
 
        * backend/pdf/ev-poppler.cc:
index 84554116af0d7214c6ad9733a8aa2252050fccb5..38a01fd49679f8fe81d2383a82347fb38133dbd7 100644 (file)
@@ -1293,7 +1293,15 @@ pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails
        g_return_val_if_fail (poppler_page != NULL, NULL);
 
        pixbuf = poppler_page_get_thumbnail (poppler_page);
-       if (!pixbuf) {
+       if (pixbuf) {
+               /* Rotate provided thumbnail if needed */
+               GdkPixbuf *rotated_pixbuf;
+
+               rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf,
+                                                          (GdkPixbufRotation) (360 - rc->rotation));
+               g_object_unref (pixbuf);
+               pixbuf = rotated_pixbuf;
+       } else {
                /* There is no provided thumbnail.  We need to make one. */
                pixbuf = make_thumbnail_for_page (pdf_document, poppler_page, rc);
        }