Package: mat / 0.6.1-4

Disable-PDF-support.-Closes-826101.patch Patch series | download
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
From: intrigeri <intrigeri@boum.org>
Date: Fri, 26 Aug 2016 08:38:03 +0000
Subject: Disable PDF support. (Closes: #826101)

Bug-Debian: https://bugs.debian.org/826101
Bug-Upstream: https://0xacab.org/mat/mat/issues/11067
Forwarded: not-needed
---
 data/FORMATS        | 10 ----------
 libmat/strippers.py | 27 ---------------------------
 test/test.py        |  2 +-
 3 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/data/FORMATS b/data/FORMATS
index 50a3a92..d5222a9 100644
--- a/data/FORMATS
+++ b/data/FORMATS
@@ -50,16 +50,6 @@
     </format>
 
     <format>
-        <name>Portable Document Fileformat</name>
-        <extension>.pdf</extension>
-        <mimetype>application/pdf</mimetype>
-        <support>Full</support>
-        <metadata>A lot</metadata>
-        <method>Rendering of the PDF file on a cairo surface with the help of poppler.</method>
-        <remaining>None</remaining>
-    </format>
-
-    <format>
         <name>Tape ARchive</name>
         <extension>.tar, .tar.bz2, .tar.gz</extension>
         <mimetype>application/x-tar, application/x-gzip, application/x-bzip2</mimetype>
diff --git a/libmat/strippers.py b/libmat/strippers.py
index 6a51aa8..6ec4ed2 100644
--- a/libmat/strippers.py
+++ b/libmat/strippers.py
@@ -22,33 +22,6 @@ STRIPPERS = {
 
 logging.basicConfig(level=mat.LOGGING_LEVEL)
 
-# PDF support
-pdfSupport = True
-try:
-    import gi
-    gi.require_version('Poppler', '0.18')
-    from gi.repository import Poppler
-except ImportError:
-    logging.error('Unable to import Poppler: no PDF support')
-    pdfSupport = False
-
-try:
-    import cairo
-except ImportError:
-    logging.error('Unable to import python-cairo: no PDF support')
-    pdfSupport = False
-
-try:
-    import pdfrw
-except ImportError:
-    logging.error('Unable to import python-pdfrw: no PDF support')
-    pdfSupport = False
-
-if pdfSupport:
-    STRIPPERS['application/x-pdf'] = office.PdfStripper
-    STRIPPERS['application/pdf'] = office.PdfStripper
-
-
 # audio format support with mutagen-python
 try:
     import mutagen
diff --git a/test/test.py b/test/test.py
index 58e7ec7..8cccf40 100644
--- a/test/test.py
+++ b/test/test.py
@@ -23,7 +23,7 @@ clean.sort()
 dirty = glob.glob('dirty*')
 dirty.sort()
 
-FILE_LIST = zip(clean, dirty)
+FILE_LIST = [pair for pair in zip(clean, dirty) if not pair[0].endswith('pdf')]
 
 try:  # PDF render processing
     import cairo