X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=thumbnailer%2Fevince-thumbnailer.c;h=217210b651167fc4a10daf1129d97a066583ae2d;hb=5c28946a3485ad6657985ac294c6a21089a0570c;hp=8960f18065ff9bad665ebaed9a6bcfd8e2c3b1dc;hpb=36c0e159a0421af3b2dfe0e700a75b899a475c2e;p=evince.git diff --git a/thumbnailer/evince-thumbnailer.c b/thumbnailer/evince-thumbnailer.c index 8960f180..217210b6 100644 --- a/thumbnailer/evince-thumbnailer.c +++ b/thumbnailer/evince-thumbnailer.c @@ -18,11 +18,7 @@ #include -#include -#include -#include -#include -#include +#include #include @@ -65,13 +61,17 @@ evince_thumbnail_pngenc_get (EvDocument *document, const char *thumbnail, int si EvRenderContext *rc; double width, height; GdkPixbuf *pixbuf; + EvPage *page; - ev_document_get_page_size (document, 0, &width, &height); + page = ev_document_get_page (document, 0); + + ev_document_get_page_size (document, page, &width, &height); - rc = ev_render_context_new (0, 0, size / width); + rc = ev_render_context_new (page, 0, size / width); pixbuf = ev_document_thumbnails_get_thumbnail (EV_DOCUMENT_THUMBNAILS (document), rc, FALSE); g_object_unref (rc); + g_object_unref (page); if (pixbuf != NULL) { const char *overlaid_icon_name = NULL; @@ -163,7 +163,8 @@ main (int argc, char *argv[]) if (!g_thread_supported ()) g_thread_init (NULL); - ev_backends_manager_init (); + if (!ev_init ()) + return -1; file = g_file_new_for_commandline_arg (input); uri = g_file_get_uri (file); @@ -173,13 +174,13 @@ main (int argc, char *argv[]) g_free (uri); if (!document) { - ev_backends_manager_shutdown (); + ev_shutdown (); return -2; } if (!EV_IS_DOCUMENT_THUMBNAILS (document)) { g_object_unref (document); - ev_backends_manager_shutdown (); + ev_shutdown (); return -2; } @@ -198,19 +199,19 @@ main (int argc, char *argv[]) gtk_main (); g_object_unref (document); - ev_backends_manager_shutdown (); + ev_shutdown (); return data.success ? 0 : -2; } if (!evince_thumbnail_pngenc_get (document, output, size)) { g_object_unref (document); - ev_backends_manager_shutdown (); + ev_shutdown (); return -2; } g_object_unref (document); - ev_backends_manager_shutdown (); + ev_shutdown (); return 0; }