Return to PyMuPDF 1.12.5

This commit is contained in:
James R. Barlow
2018-05-10 18:47:10 -07:00
parent c9ce731119
commit 601863f9e9
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ setup(
'ruffus == 2.6.3', # pinned - ocrmypdf implements a 2.6.3 workaround
],
extras_require={
'fitz': ['PyMuPDF >= 1.13.3'],
'fitz': ['PyMuPDF == 1.12.5'],
},
tests_require=tests_require,
entry_points={
+6 -1
View File
@@ -586,7 +586,12 @@ def _page_get_textblocks(infile, pageno):
"Smarter text detection"
doc = fitz.Document(infile)
text = doc[pageno].getText('dict')
if fitz.version[0] >= '1.13.0':
text = doc[pageno].getText('dict')
else:
import json
textjson = doc[pageno].getText('json')
text = json.loads(textjson)
if not text:
return