summaryrefslogtreecommitdiff
path: root/office/zathura-pdf-mupdf/patches/0004-Enable-EPUB-support.patch.disabled
blob: 3c731be7813954034449972321abf067faa6180f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 00792eae08aafb5ba2f429b1cdee0a5fe9c25c61 Mon Sep 17 00:00:00 2001
From: Moritz Lipp <mlq@pwmt.org>
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