Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fa28d7e74 | ||
|
|
bed74501fc | ||
|
|
e821ca46d5 | ||
|
|
a29e4952fb | ||
|
|
4cc0dc6b4a | ||
|
|
7263702de9 |
Vendored
+1
-1
@@ -43,7 +43,7 @@ Copyright: (C) 2014 Armin Ronacher
|
|||||||
(C) 2017 James R. Barlow
|
(C) 2017 James R. Barlow
|
||||||
License: BSD-3-clause
|
License: BSD-3-clause
|
||||||
|
|
||||||
Files: tests/spoof/*
|
Files: tests/plugins/*
|
||||||
Copyright: (C) 2016, 2017, 2016-2018 James R. Barlow
|
Copyright: (C) 2016, 2017, 2016-2018 James R. Barlow
|
||||||
License: Expat
|
License: Expat
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,10 @@ Forking a child process to call ``ocrmypdf.ocr()`` is suggested. That
|
|||||||
way your application will survive and remain interactive even if
|
way your application will survive and remain interactive even if
|
||||||
OCRmyPDF does not.
|
OCRmyPDF does not.
|
||||||
|
|
||||||
|
Programs that call ``ocrmypdf.ocr()`` should also install a SIGBUS signal
|
||||||
|
handler (except on Windows), to raise an exception if access to a memory
|
||||||
|
mapped file fails. OCRmyPDF may use memory mapping.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
On Windows, the script that calls ``ocrmypdf.ocr()`` must be protected
|
On Windows, the script that calls ``ocrmypdf.ocr()`` must be protected
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ Note that it is licensed under GPLv3, so scripts that
|
|||||||
``import ocrmypdf`` and are released publicly should probably also be
|
``import ocrmypdf`` and are released publicly should probably also be
|
||||||
licensed under GPLv3.
|
licensed under GPLv3.
|
||||||
|
|
||||||
|
v10.3.2
|
||||||
|
=======
|
||||||
|
|
||||||
|
- Fixed a case where we reported "no reason" for a file size increase, when we
|
||||||
|
could determine the reason.
|
||||||
|
- Enabled support for pdfminer.six 20200726.
|
||||||
|
|
||||||
v10.3.1
|
v10.3.1
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ setup(
|
|||||||
'cffi >= 1.9.1', # must be a setup and install requirement
|
'cffi >= 1.9.1', # must be a setup and install requirement
|
||||||
'coloredlogs >= 14.0', # strictly optional
|
'coloredlogs >= 14.0', # strictly optional
|
||||||
'img2pdf >= 0.3.0, < 0.4', # pure Python, so track HEAD closely
|
'img2pdf >= 0.3.0, < 0.4', # pure Python, so track HEAD closely
|
||||||
'pdfminer.six >= 20191110, <= 20200720',
|
'pdfminer.six >= 20191110, <= 20200726',
|
||||||
'pikepdf >= 1.14.0, < 2',
|
'pikepdf >= 1.14.0, < 2',
|
||||||
'Pillow >= 7.0.0',
|
'Pillow >= 7.0.0',
|
||||||
'pluggy >= 0.13.0',
|
'pluggy >= 0.13.0',
|
||||||
|
|||||||
@@ -416,6 +416,10 @@ def report_output_file_size(options, input_file, output_file):
|
|||||||
f"The optional dependency '{name}' was not found, so some image "
|
f"The optional dependency '{name}' was not found, so some image "
|
||||||
f"optimizations could not be attempted."
|
f"optimizations could not be attempted."
|
||||||
)
|
)
|
||||||
|
if options.output_type.startswith('pdfa'):
|
||||||
|
reasons.append("PDF/A conversion was enabled. (Try `--output-type pdf`.)")
|
||||||
|
if options.plugins:
|
||||||
|
reasons.append("Plugins were used.")
|
||||||
|
|
||||||
if reasons:
|
if reasons:
|
||||||
explanation = "Possible reasons for this include:\n" + '\n'.join(reasons) + "\n"
|
explanation = "Possible reasons for this include:\n" + '\n'.join(reasons) + "\n"
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
# © 2019 James R. Barlow: github.com/jbarlow83
|
|
||||||
#
|
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
# copy of this software and associated documentation files (the
|
|
||||||
# "Software"), to deal in the Software without restriction, including
|
|
||||||
# without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
# permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
# the following conditions:
|
|
||||||
#
|
|
||||||
# The above copyright notice and this permission notice shall be included
|
|
||||||
# in all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
"""Find Ghostscript executable"""
|
|
||||||
|
|
||||||
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
|
|
||||||
def real_ghostscript(argv):
|
|
||||||
if os.name != 'nt':
|
|
||||||
gs = shutil.which('gs')
|
|
||||||
gs_args = [gs] + argv[1:]
|
|
||||||
os.execv(gs_args[0], gs_args)
|
|
||||||
else:
|
|
||||||
gs = shutil.which('gswin64c')
|
|
||||||
if not gs:
|
|
||||||
gs = shutil.which('gswin32c')
|
|
||||||
os.execv(gs, argv[1:])
|
|
||||||
|
|
||||||
return # Not reachable
|
|
||||||
@@ -21,7 +21,7 @@ from unittest.mock import patch
|
|||||||
import pikepdf
|
import pikepdf
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import ocrmypdf._validation as vd
|
from ocrmypdf import _validation as vd
|
||||||
from ocrmypdf._plugin_manager import get_plugin_manager
|
from ocrmypdf._plugin_manager import get_plugin_manager
|
||||||
from ocrmypdf.api import create_options
|
from ocrmypdf.api import create_options
|
||||||
from ocrmypdf.cli import get_parser
|
from ocrmypdf.cli import get_parser
|
||||||
@@ -141,7 +141,7 @@ def test_report_file_size(tmp_path, caplog):
|
|||||||
pdf = pikepdf.new()
|
pdf = pikepdf.new()
|
||||||
pdf.save(in_)
|
pdf.save(in_)
|
||||||
pdf.save(out)
|
pdf.save(out)
|
||||||
opts = make_opts()
|
opts = make_opts(output_type='pdf')
|
||||||
vd.report_output_file_size(opts, in_, out)
|
vd.report_output_file_size(opts, in_, out)
|
||||||
assert caplog.text == ''
|
assert caplog.text == ''
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
@@ -166,7 +166,7 @@ def test_report_file_size(tmp_path, caplog):
|
|||||||
assert 'optional dependency' in caplog.text
|
assert 'optional dependency' in caplog.text
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
|
|
||||||
opts = make_opts(in_, out, optimize=0)
|
opts = make_opts(in_, out, optimize=0, output_type='pdf')
|
||||||
vd.report_output_file_size(opts, in_, out)
|
vd.report_output_file_size(opts, in_, out)
|
||||||
assert 'disabled' in caplog.text
|
assert 'disabled' in caplog.text
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user