From 00792eae08aafb5ba2f429b1cdee0a5fe9c25c61 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Sun, 19 Apr 2015 10:49:20 +0200 Subject: [PATCH 4/6] Enable EPUB support --- document.c | 8 +++----- plugin.c | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/document.c b/document.c index 38e70b5..de805bb 100644 --- a/document.c +++ b/document.c @@ -34,11 +34,9 @@ pdf_document_open(zathura_document_t* document) const char* password = zathura_document_get_password(document); fz_try(mupdf_document->ctx){ - if (strstr(path, ".xps") != 0 || strstr(path, ".XPS") != 0 || strstr(path, ".rels") != 0) { - mupdf_document->document = (fz_document*) xps_open_document(mupdf_document->ctx, (char*) path); - } else { - mupdf_document->document = (fz_document*) pdf_open_document(mupdf_document->ctx, (char*) path); - } + fz_register_document_handlers(mupdf_document->ctx); + + mupdf_document->document = fz_open_document(mupdf_document->ctx, path); } fz_catch(mupdf_document->ctx){ error = ZATHURA_ERROR_UNKNOWN; diff --git a/plugin.c b/plugin.c index a115db4..86cb8de 100644 --- a/plugin.c +++ b/plugin.c @@ -32,6 +32,7 @@ ZATHURA_PLUGIN_REGISTER( register_functions, ZATHURA_PLUGIN_MIMETYPES({ "application/pdf", - "application/oxps" + "application/oxps", + "application/epub+zip" }) ) -- 1.8.4