Commit 14fbe0f7 authored by Moritz Lipp's avatar Moritz Lipp
Browse files

Render ddjvu document

parent 14d744be
...@@ -56,6 +56,23 @@ djvu_document_open(zathura_document_t* document) ...@@ -56,6 +56,23 @@ djvu_document_open(zathura_document_t* document)
goto error_free; goto error_free;
} }
/* load document info */
ddjvu_message_t* msg;
ddjvu_message_wait(djvu_document->context);
while((msg = ddjvu_message_peek(djvu_document->context)) && (msg->m_any.tag != DDJVU_DOCINFO)) {
if(msg->m_any.tag == DDJVU_ERROR) {
goto error_free;
}
ddjvu_message_pop(djvu_document->context);
}
/* decoding error */
if(ddjvu_document_decoding_error(djvu_document->document)) {
goto error_free;
}
document->number_of_pages = ddjvu_document_get_pagenum(djvu_document->document); document->number_of_pages = ddjvu_document_get_pagenum(djvu_document->document);
return true; return true;
...@@ -150,6 +167,8 @@ djvu_page_get(zathura_document_t* document, unsigned int page) ...@@ -150,6 +167,8 @@ djvu_page_get(zathura_document_t* document, unsigned int page)
return NULL; return NULL;
} }
while(!ddjvu_page_decoding_done(document_page->data));
document_page->width = ddjvu_page_get_width(document_page->data); document_page->width = ddjvu_page_get_width(document_page->data);
document_page->height = ddjvu_page_get_width(document_page->data); document_page->height = ddjvu_page_get_width(document_page->data);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment