Revert "Since PyMuPDF 1.13.3 corrupts text, pin 1.12.5 and work around it"
This reverts commit b0ce7c63dd.
This commit is contained in:
@@ -251,7 +251,7 @@ setup(
|
||||
'ruffus == 2.6.3', # pinned - ocrmypdf implements a 2.6.3 workaround
|
||||
],
|
||||
extras_require={
|
||||
'fitz': ['PyMuPDF == 1.12.5'],
|
||||
'fitz': ['PyMuPDF >= 1.13.3'],
|
||||
},
|
||||
tests_require=tests_require,
|
||||
entry_points={
|
||||
|
||||
@@ -586,12 +586,7 @@ def _page_get_textblocks(infile, pageno):
|
||||
"Smarter text detection"
|
||||
|
||||
doc = fitz.Document(infile)
|
||||
if fitz.version[0] >= '1.13.0':
|
||||
text = doc[pageno].getText('dict')
|
||||
else:
|
||||
import json
|
||||
textjson = doc[pageno].getText('json')
|
||||
text = json.loads(textjson)
|
||||
text = doc[pageno].getText('dict')
|
||||
if not text:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user