X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=djvu%2Fdjvu-document.c;h=9f22537f3751fd76c558095c8f3ea24ab6496c09;hb=b66c8a73177b462aebcb6e495341807abb31a93f;hp=8257b3e328154aaaa693216c5f1d3ae97d5cf0e9;hpb=5e43774b418b9ed521660463f912fa88809bd551;p=evince.git diff --git a/djvu/djvu-document.c b/djvu/djvu-document.c index 8257b3e3..9f22537f 100644 --- a/djvu/djvu-document.c +++ b/djvu/djvu-document.c @@ -259,15 +259,10 @@ djvu_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document, djvu_document_thumbnails_get_dimensions (document, page, width, &thumb_width, &thumb_height); - if (border) { - pixbuf = ev_document_misc_get_thumbnail_frame (thumb_width, thumb_height, NULL); - pixels = gdk_pixbuf_get_pixels (pixbuf) + gdk_pixbuf_get_rowstride (pixbuf) + 4; - } else { - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, - thumb_width, thumb_height); - gdk_pixbuf_fill (pixbuf, 0xffffffff); - pixels = gdk_pixbuf_get_pixels (pixbuf); - } + pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, + thumb_width, thumb_height); + gdk_pixbuf_fill (pixbuf, 0xffffffff); + pixels = gdk_pixbuf_get_pixels (pixbuf); while (ddjvu_thumbnail_status (djvu_document->d_document, page, 1) < DDJVU_JOB_OK) { ddjvu_message_wait (djvu_document->d_context); @@ -282,6 +277,12 @@ djvu_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document, rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, 360 - rotation); g_object_unref (pixbuf); + + if (border) { + GdkPixbuf *tmp_pixbuf = rotated_pixbuf; + rotated_pixbuf = ev_document_misc_get_thumbnail_frame (-1, -1, 0, tmp_pixbuf); + g_object_unref (tmp_pixbuf); + } return rotated_pixbuf; }