Ensure Poppler's minimal version
We're using methods that aren't available in Poppler below 0.46, so we're checking for this upon import. This commit is based on ideas from @LogicalDash ♥
This commit is contained in:
parent
1e9906de29
commit
f44769df41
@ -7,6 +7,7 @@ import re
|
||||
import logging
|
||||
import tempfile
|
||||
import io
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
import cairo
|
||||
import gi
|
||||
@ -17,6 +18,11 @@ from . import abstract
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
poppler_version = Poppler.get_version()
|
||||
if LooseVersion(poppler_version) < LooseVersion('0.46'):
|
||||
raise ValueError("MAT2 needs at least Poppler version 0.46 to work. \
|
||||
The installed version is %s." % poppler_version)
|
||||
|
||||
|
||||
class PDFParser(abstract.AbstractParser):
|
||||
mimetypes = {'application/pdf', }
|
||||
|
Loading…
Reference in New Issue
Block a user