From 891cb3e7733ab34e949e3aeef1f3461ab2431717 Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Sun, 29 May 2005 11:27:28 +0000 Subject: [PATCH] Improve djvu loading speed. Fix for 301993 --- ChangeLog | 8 ++++++++ configure.ac | 12 +++++++++++- djvu/djvu-document.c | 13 ++++--------- po/ru.po | 1 - 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 541ba77d..d27f29e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-05-29 Nickolay V. Shmyrev + + * configure.ac: + * djvu/djvu-document.c: (djvu_document_get_page_size): + + Require djvulibre CVS. Now djvu loading is much faster. Fix for + bug 301993. + Sat May 28 07:38:03 2005 Jonathan Blandford * shell/ev-view.c (draw_one_page): modify the expose handling to diff --git a/configure.ac b/configure.ac index 8532cb3a..f958ab22 100644 --- a/configure.ac +++ b/configure.ac @@ -131,14 +131,24 @@ AC_ARG_ENABLE(djvu, if test "x$enable_djvu" = "xyes"; then AC_CHECK_HEADERS([libdjvu/ddjvuapi.h],enable_djvu=yes,enable_djvu=no,) + if test "x$enable_djvu" = "xyes"; then AC_CHECK_LIB([djvulibre],ddjvu_context_create,enable_djvu=yes,enable_djvu=no,"-lpthread") + AC_CHECK_LIB([djvulibre],ddjvu_document_get_pageinfo,enable_djvu=yes,enable_djvu=no,"-lpthread") fi if test "x$enable_djvu" = "xyes"; then AC_DEFINE([ENABLE_DJVU], [1], [Enable djvu viewer support.]) else - AC_MSG_WARN("Djvu support is disabled since djvulibre library version 3.5.14 or newer is not found") + AC_MSG_WARN([ +** Djvu support is disabled since recent version of djvulibre +** library was not found. To get proper djvu support you need to +** install development version of djvulibre. You can get it from +** anonymous CVS server on djvulibre.sf.net. Just use something +** like: + +** cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/djvu co djvulibre-3.5 +]) fi fi diff --git a/djvu/djvu-document.c b/djvu/djvu-document.c index aa853a71..d82a643f 100644 --- a/djvu/djvu-document.c +++ b/djvu/djvu-document.c @@ -116,24 +116,19 @@ djvu_document_get_page_size (EvDocument *document, double *height) { DjvuDocument *djvu_document = DJVU_DOCUMENT (document); - - ddjvu_page_t *d_page; + ddjvu_pageinfo_t info; g_return_if_fail (djvu_document->d_document); - d_page = ddjvu_page_create_by_pageno (djvu_document->d_document, page); - - while (!ddjvu_page_decoding_done (d_page)) { + while (ddjvu_document_get_pageinfo(djvu_document->d_document, page, &info) < DDJVU_JOB_OK) { ddjvu_message_wait (djvu_document->d_context); ddjvu_message_pop (djvu_document->d_context); } if (width) - *width = ddjvu_page_get_width (d_page) * SCALE_FACTOR; + *width = info.width * SCALE_FACTOR; if (height) - *height = ddjvu_page_get_height (d_page) * SCALE_FACTOR; - - ddjvu_page_release (d_page); + *height = info.height * SCALE_FACTOR; } static GdkPixbuf * diff --git a/po/ru.po b/po/ru.po index 2aee102d..624cf223 100644 --- a/po/ru.po +++ b/po/ru.po @@ -17,7 +17,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #. translators: this is the label for toolbar button #: cut-n-paste/zoom-control/ephy-zoom.h:48 shell/ev-window.c:2505 -- 2.43.5