Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
158f902c3b | ||
|
|
6dc25ddc6e | ||
|
|
7f6aaeaecf | ||
|
|
ace439910e | ||
|
|
7f038568de |
@@ -5,6 +5,14 @@ OCRmyPDF uses `semantic versioning <http://semver.org/>`_ for its command line i
|
|||||||
|
|
||||||
The OCRmyPDF package itself does not contain a public API, although it is fairly stable and breaking changes are usually timed with a major release. A future release will clearly define the stable public API.
|
The OCRmyPDF package itself does not contain a public API, although it is fairly stable and breaking changes are usually timed with a major release. A future release will clearly define the stable public API.
|
||||||
|
|
||||||
|
v6.1.2
|
||||||
|
------
|
||||||
|
|
||||||
|
- Upgrade to PyMuPDF v1.12.5 which includes a more complete fix to #239.
|
||||||
|
|
||||||
|
- Add ``defusedxml`` dependency.
|
||||||
|
|
||||||
|
|
||||||
v6.1.1
|
v6.1.1
|
||||||
------
|
------
|
||||||
|
|
||||||
|
|||||||
@@ -12,3 +12,6 @@ ignore =
|
|||||||
norecursedirs = lib .pc .git output cache resources
|
norecursedirs = lib .pc .git output cache resources
|
||||||
testpaths = tests
|
testpaths = tests
|
||||||
addopts = -n auto
|
addopts = -n auto
|
||||||
|
|
||||||
|
[metadata]
|
||||||
|
license_file = LICENSE
|
||||||
@@ -232,26 +232,27 @@ setup(
|
|||||||
"Topic :: Text Processing :: Indexing",
|
"Topic :: Text Processing :: Indexing",
|
||||||
"Topic :: Text Processing :: Linguistic",
|
"Topic :: Text Processing :: Linguistic",
|
||||||
],
|
],
|
||||||
python_requires='>=3.5',
|
python_requires=' >= 3.5',
|
||||||
setup_requires=[
|
setup_requires=[
|
||||||
|
'cffi >= 1.9.1', # to build the leptonica module
|
||||||
|
'pytest-runner', # to enable python setup.py test
|
||||||
'setuptools_scm', # so that version will work
|
'setuptools_scm', # so that version will work
|
||||||
'cffi>=1.9.1', # to build the leptonica module
|
|
||||||
'pytest-runner' # to enable python setup.py test
|
|
||||||
],
|
],
|
||||||
use_scm_version={'version_scheme': 'post-release'},
|
use_scm_version={'version_scheme': 'post-release'},
|
||||||
cffi_modules=[
|
cffi_modules=[
|
||||||
'src/ocrmypdf/lib/compile_leptonica.py:ffibuilder'
|
'src/ocrmypdf/lib/compile_leptonica.py:ffibuilder'
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'ruffus==2.6.3', # pinned - ocrmypdf implements a 2.6.3 workaround
|
'cffi >= 1.9.1', # must be a setup and install requirement
|
||||||
'Pillow>=4.0.0', # Pillow < 4 has BytesIO/TIFF bug w/img2pdf 0.2.3
|
'defusedxml >= 0.5.0', # pure Python, so track HEAD closely
|
||||||
'reportlab>=3.3.0', # oldest released version with sane image handling
|
'img2pdf >= 0.2.4', # pure Python, so track HEAD closely
|
||||||
'PyPDF2>=1.26', # pure Python, so track HEAD closely
|
'Pillow >= 4.0.0', # Pillow < 4 has BytesIO/TIFF bug w/img2pdf 0.2.3
|
||||||
'img2pdf>=0.2.3', # pure Python, so track HEAD closely
|
'PyPDF2 >= 1.26', # pure Python, so track HEAD closely
|
||||||
'cffi>=1.9.1', # must be a setup and install requirement
|
'reportlab >= 3.3.0', # oldest released version with sane image handling
|
||||||
|
'ruffus == 2.6.3', # pinned - ocrmypdf implements a 2.6.3 workaround
|
||||||
],
|
],
|
||||||
extras_require={
|
extras_require={
|
||||||
'fitz': ['PyMuPDF == 1.12.4'] # pinned to avoid problems with 1.12.4.x
|
'fitz': ['PyMuPDF >= 1.12.5'] # for table of contents bug
|
||||||
},
|
},
|
||||||
tests_require=tests_require,
|
tests_require=tests_require,
|
||||||
entry_points={
|
entry_points={
|
||||||
|
|||||||
@@ -17,7 +17,12 @@
|
|||||||
|
|
||||||
"""Bindings to external libraries"""
|
"""Bindings to external libraries"""
|
||||||
|
|
||||||
|
import os as _os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import fitz
|
import fitz
|
||||||
except ImportError:
|
except ImportError:
|
||||||
fitz = None
|
fitz = None
|
||||||
|
|
||||||
|
if _os.environ.get('_OCRMYPDF_NO_FITZ'):
|
||||||
|
fitz = None
|
||||||
@@ -1039,12 +1039,7 @@ def merge_pages_mupdf(
|
|||||||
|
|
||||||
metadata = fitz.open(metadata_file)
|
metadata = fitz.open(metadata_file)
|
||||||
toc = metadata.getToC(simple=False)
|
toc = metadata.getToC(simple=False)
|
||||||
def filter_toc_pages():
|
doc.setToC(toc)
|
||||||
"fitz does not escape parens properly"
|
|
||||||
for entry in toc:
|
|
||||||
entry[1] = entry[1].replace('(', '').replace(')', '')
|
|
||||||
yield entry
|
|
||||||
doc.setToC([item for item in filter_toc_pages()])
|
|
||||||
doc.setMetadata(pymupdf_metadata)
|
doc.setMetadata(pymupdf_metadata)
|
||||||
doc.save(output_file, garbage=4, deflate=True)
|
doc.save(output_file, garbage=4, deflate=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user