Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02d85ff070 | ||
|
|
179c36151b | ||
|
|
3c4b099cb1 | ||
|
|
15df9c370c | ||
|
|
86d92ef490 | ||
|
|
8f44b29ca3 | ||
|
|
5a08a6cfeb | ||
|
|
cc058be4b2 | ||
|
|
7565d20c0a | ||
|
|
9a075039b5 | ||
|
|
5a1c043331 | ||
|
|
fe89be5dc0 | ||
|
|
d70296b97a | ||
|
|
7d7658018d | ||
|
|
8fb8e9f72c | ||
|
|
85d6fb8ce9 | ||
|
|
828e741c24 | ||
|
|
36837f8353 | ||
|
|
12fd4f70f1 |
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
# SPDX-FileCopyrightText: 2024 James R. Barlow
|
# SPDX-FileCopyrightText: 2024 James R. Barlow
|
||||||
# SPDX-License-Identifier: MPL-2.0
|
# SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
FROM ubuntu:22.04 AS base
|
FROM ubuntu:24.04 AS base
|
||||||
|
|
||||||
ENV LANG=C.UTF-8
|
ENV LANG=C.UTF-8
|
||||||
ENV TZ=UTC
|
ENV TZ=UTC
|
||||||
@@ -40,12 +40,12 @@ COPY . /app
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN curl -LsSf https://astral.sh/uv/0.4.27/install.sh | sh
|
# Copy uv from ghcr
|
||||||
|
COPY --from=ghcr.io/astral-sh/uv:0.5.5 /uv /uvx /bin/
|
||||||
|
|
||||||
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
||||||
|
|
||||||
# Instead of restarting the shell, use uv directly from its installed location.
|
RUN uv sync --extra test --extra webservice --extra watcher --no-dev
|
||||||
RUN /root/.cargo/bin/uv sync --extra test --extra webservice --extra watcher
|
|
||||||
|
|
||||||
FROM base
|
FROM base
|
||||||
|
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ COPY . /app
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN curl -LsSf https://astral.sh/uv/0.4.27/install.sh | sh
|
COPY --from=ghcr.io/astral-sh/uv:0.5.5 /uv /uvx /bin/
|
||||||
|
|
||||||
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
||||||
|
|
||||||
# Instead of restarting the shell, use uv directly from its installed location.
|
# Instead of restarting the shell, use uv directly from its installed location.
|
||||||
RUN /root/.cargo/bin/uv sync --extra test --extra webservice --extra watcher
|
RUN uv sync --extra test --extra webservice --extra watcher --no-dev
|
||||||
|
|
||||||
FROM base
|
FROM base
|
||||||
|
|
||||||
|
|||||||
+19
-19
@@ -40,9 +40,9 @@ jobs:
|
|||||||
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags
|
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v3
|
uses: astral-sh/setup-uv@v4
|
||||||
with:
|
with:
|
||||||
version: "0.4.27"
|
version: "0.5.x"
|
||||||
|
|
||||||
- name: "Set up Python"
|
- name: "Set up Python"
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
uv sync --extra test
|
uv sync --extra test --no-dev
|
||||||
|
|
||||||
- name: Report versions
|
- name: Report versions
|
||||||
run: |
|
run: |
|
||||||
@@ -92,14 +92,14 @@ jobs:
|
|||||||
gs --version
|
gs --version
|
||||||
pngquant --version
|
pngquant --version
|
||||||
unpaper --version
|
unpaper --version
|
||||||
uv run img2pdf --version
|
uv run --no-dev img2pdf --version
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
uv run pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
|
uv run --no-dev pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v5
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -136,9 +136,9 @@ jobs:
|
|||||||
tesseract
|
tesseract
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v3
|
uses: astral-sh/setup-uv@v4
|
||||||
with:
|
with:
|
||||||
version: "0.4.27"
|
version: "0.5.x"
|
||||||
|
|
||||||
- name: "Set up Python"
|
- name: "Set up Python"
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -147,21 +147,21 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
uv sync --extra test
|
uv sync --extra test --no-dev
|
||||||
|
|
||||||
- name: Report versions
|
- name: Report versions
|
||||||
run: |
|
run: |
|
||||||
tesseract --version
|
tesseract --version
|
||||||
gs --version
|
gs --version
|
||||||
pngquant --version
|
pngquant --version
|
||||||
uv run img2pdf --version
|
uv run --no-dev img2pdf --version
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
uv run pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
|
uv run --no-dev pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v5
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -186,9 +186,9 @@ jobs:
|
|||||||
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags
|
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v3
|
uses: astral-sh/setup-uv@v4
|
||||||
with:
|
with:
|
||||||
version: "0.4.27"
|
version: "0.5.x"
|
||||||
|
|
||||||
- name: "Set up Python"
|
- name: "Set up Python"
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -202,14 +202,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
uv sync --extra test
|
uv sync --extra test --no-dev
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
uv run pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
|
uv run --no-dev pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v5
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -225,9 +225,9 @@ jobs:
|
|||||||
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags
|
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v3
|
uses: astral-sh/setup-uv@v4
|
||||||
with:
|
with:
|
||||||
version: "0.4.27"
|
version: "0.5.x"
|
||||||
|
|
||||||
- name: Make wheels and sdist
|
- name: Make wheels and sdist
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ Linux, Windows, macOS and FreeBSD are supported. Docker images are also availabl
|
|||||||
| macOS (nix) | ``nix-env -i ocrmypdf`` |
|
| macOS (nix) | ``nix-env -i ocrmypdf`` |
|
||||||
| LinuxBrew | ``brew install ocrmypdf`` |
|
| LinuxBrew | ``brew install ocrmypdf`` |
|
||||||
| FreeBSD | ``pkg install py-ocrmypdf`` |
|
| FreeBSD | ``pkg install py-ocrmypdf`` |
|
||||||
| Conda | ``conda install ocrmypdf`` |
|
|
||||||
| Ubuntu Snap | ``snap install ocrmypdf`` |
|
| Ubuntu Snap | ``snap install ocrmypdf`` |
|
||||||
|
|
||||||
For everyone else, [see our documentation](https://ocrmypdf.readthedocs.io/en/latest/installation.html) for installation steps.
|
For everyone else, [see our documentation](https://ocrmypdf.readthedocs.io/en/latest/installation.html) for installation steps.
|
||||||
@@ -113,9 +112,33 @@ Our [documentation is served on Read the Docs](https://ocrmypdf.readthedocs.io/e
|
|||||||
|
|
||||||
Please report issues on our [GitHub issues](https://github.com/ocrmypdf/OCRmyPDF/issues) page, and follow the issue template for quick response.
|
Please report issues on our [GitHub issues](https://github.com/ocrmypdf/OCRmyPDF/issues) page, and follow the issue template for quick response.
|
||||||
|
|
||||||
|
## Feature demo
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Add an OCR layer and convert to PDF/A
|
||||||
|
ocrmypdf input.pdf output.pdf
|
||||||
|
|
||||||
|
# Convert an image to single page PDF
|
||||||
|
ocrmypdf input.jpg output.pdf
|
||||||
|
|
||||||
|
# Add OCR to a file in place (only modifies file on success)
|
||||||
|
ocrmypdf myfile.pdf myfile.pdf
|
||||||
|
|
||||||
|
# OCR with non-English languages (look up your language's ISO 639-3 code)
|
||||||
|
ocrmypdf -l fra LeParisien.pdf LeParisien.pdf
|
||||||
|
|
||||||
|
# OCR multilingual documents
|
||||||
|
ocrmypdf -l eng+fra Bilingual-English-French.pdf Bilingual-English-French.pdf
|
||||||
|
|
||||||
|
# Deskew (straighten crooked pages)
|
||||||
|
ocrmypdf --deskew input.pdf output.pdf
|
||||||
|
```
|
||||||
|
|
||||||
|
For more features, see the [documentation](https://ocrmypdf.readthedocs.io/en/latest/index.html).
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
In addition to the required Python version (3.8+), OCRmyPDF requires external program installations of Ghostscript and Tesseract OCR. OCRmyPDF is pure Python, and runs on pretty much everything: Linux, macOS, Windows and FreeBSD.
|
In addition to the required Python version, OCRmyPDF requires external program installations of Ghostscript and Tesseract OCR. OCRmyPDF is pure Python, and runs on pretty much everything: Linux, macOS, Windows and FreeBSD.
|
||||||
|
|
||||||
## Press & Media
|
## Press & Media
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -445,7 +445,7 @@ Debugging the intermediate files
|
|||||||
OCRmyPDF normally saves its intermediate results to a temporary folder
|
OCRmyPDF normally saves its intermediate results to a temporary folder
|
||||||
and deletes this folder when it exits, whether it succeeded or failed.
|
and deletes this folder when it exits, whether it succeeded or failed.
|
||||||
|
|
||||||
If the ``--keep-temporary-files`` (``-k```) argument is issued on the
|
If the ``--keep-temporary-files`` (``-k``) argument is issued on the
|
||||||
command line, OCRmyPDF will keep the temporary folder and print the location,
|
command line, OCRmyPDF will keep the temporary folder and print the location,
|
||||||
whether it succeeded or failed. An example message is:
|
whether it succeeded or failed. An example message is:
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ extensions = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
# Extension settings
|
# Extension settings
|
||||||
intersphinx_mapping = {'https://docs.python.org/': None}
|
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
|
||||||
napoleon_use_rtype = False
|
napoleon_use_rtype = False
|
||||||
issues_github_path = "ocrmypdf/OCRmyPDF"
|
issues_github_path = "ocrmypdf/OCRmyPDF"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -399,7 +399,7 @@ Some users may consider enabling lossy JBIG2. See: :ref:`jbig2-lossy`.
|
|||||||
Digitally signed PDFs
|
Digitally signed PDFs
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
OCRmyPDF cannot preserve digital signatures in PDFs and also add to OCR to them.
|
OCRmyPDF cannot preserve digital signatures in PDFs and also add OCR to them.
|
||||||
By default, it will refuse to modify a signed PDF regardless of other settings. You can
|
By default, it will refuse to modify a signed PDF regardless of other settings. You can
|
||||||
override this behavior with ``--invalidate-digital-signatures``; as the name suggests,
|
override this behavior with ``--invalidate-digital-signatures``; as the name suggests,
|
||||||
any digital signatures will be invalidated.
|
any digital signatures will be invalidated.
|
||||||
|
|||||||
+3
-3
@@ -69,9 +69,9 @@ OCRmyPDF will use all available CPU cores. See the Docker documentation for
|
|||||||
if you are using Docker on macOS or Windows, where you may need to manually assign
|
if you are using Docker on macOS or Windows, where you may need to manually assign
|
||||||
more resources. On Linux, all resources will be available automatically.
|
more resources. On Linux, all resources will be available automatically.
|
||||||
|
|
||||||
The underlying operating system and other details in Docker images are subject
|
The underlying operating system and other details in Docker images are considered
|
||||||
to change at minor releases. If you are modifying the image, you should pin
|
implementation details and **subject to change at minor releases**. If you are
|
||||||
the version you intend to use.
|
modifying the image, you should pin the version you intend to use.
|
||||||
|
|
||||||
Using the Docker image on the command line
|
Using the Docker image on the command line
|
||||||
==========================================
|
==========================================
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ These platforms have one-liner installs:
|
|||||||
+-------------------------------+-----------------------------------------+
|
+-------------------------------+-----------------------------------------+
|
||||||
| FreeBSD | ``pkg install textproc/py-ocrmypdf`` |
|
| FreeBSD | ``pkg install textproc/py-ocrmypdf`` |
|
||||||
+-------------------------------+-----------------------------------------+
|
+-------------------------------+-----------------------------------------+
|
||||||
| Conda (WSL, macOS, Linux) | ``conda install ocrmypdf`` |
|
|
||||||
+-------------------------------+-----------------------------------------+
|
|
||||||
| Snap (snapcraft packaging) | ``snap install ocrmypdf`` |
|
| Snap (snapcraft packaging) | ``snap install ocrmypdf`` |
|
||||||
+-------------------------------+-----------------------------------------+
|
+-------------------------------+-----------------------------------------+
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,17 @@ OCRmyPDF typically supports the three most recent Python versions.
|
|||||||
|
|
||||||
.. |OCRmyPDF PyPI| image:: https://img.shields.io/pypi/v/ocrmypdf.svg
|
.. |OCRmyPDF PyPI| image:: https://img.shields.io/pypi/v/ocrmypdf.svg
|
||||||
|
|
||||||
|
v16.7.0
|
||||||
|
=======
|
||||||
|
|
||||||
|
- Fixed further issues with Docker build and updated some versions.
|
||||||
|
- Main Docker image returned to Ubuntu 24.04 since the fix in v16.6.2 resolved
|
||||||
|
that concern.
|
||||||
|
- Code that previously sent Ghostscript output to stdout has been changed to
|
||||||
|
output to temporary files, since Ghostscript was doing that anyway internally.
|
||||||
|
This is a modest efficiency improvement.
|
||||||
|
- Fixed an issue with debug log output being parsed as rich markup. :issue:`1444`
|
||||||
|
|
||||||
v16.6.2
|
v16.6.2
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
|||||||
+6
-3
@@ -118,8 +118,6 @@ filterwarnings = [
|
|||||||
[[tool.mypy.overrides]]
|
[[tool.mypy.overrides]]
|
||||||
module = [
|
module = [
|
||||||
'pluggy',
|
'pluggy',
|
||||||
'tqdm',
|
|
||||||
'coloredlogs',
|
|
||||||
'img2pdf',
|
'img2pdf',
|
||||||
'pdfminer.*',
|
'pdfminer.*',
|
||||||
'reportlab.*',
|
'reportlab.*',
|
||||||
@@ -157,4 +155,9 @@ convention = "google"
|
|||||||
quote-style = "preserve"
|
quote-style = "preserve"
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
dev = ["mypy>=1.13.0"]
|
dev = [
|
||||||
|
"mypy>=1.13.0",
|
||||||
|
"pymupdf>=1.24.14",
|
||||||
|
"streamlit-pdf-viewer>=0.0.19",
|
||||||
|
"streamlit>=1.40.2",
|
||||||
|
]
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ def rasterize_pdf(
|
|||||||
+ (['-dPDFSTOPONERROR'] if stop_on_error else [])
|
+ (['-dPDFSTOPONERROR'] if stop_on_error else [])
|
||||||
+ [
|
+ [
|
||||||
'-o',
|
'-o',
|
||||||
'-',
|
fspath(output_file),
|
||||||
'-sstdout=%stderr', # Literal %s, not string interpolation
|
'-sstdout=%stderr', # Literal %s, not string interpolation
|
||||||
'-dAutoRotatePages=/None', # Probably has no effect on raster
|
'-dAutoRotatePages=/None', # Probably has no effect on raster
|
||||||
'-f',
|
'-f',
|
||||||
@@ -137,14 +137,15 @@ def rasterize_pdf(
|
|||||||
p = run(args_gs, stdout=PIPE, stderr=PIPE, check=True)
|
p = run(args_gs, stdout=PIPE, stderr=PIPE, check=True)
|
||||||
except CalledProcessError as e:
|
except CalledProcessError as e:
|
||||||
log.error(e.stderr.decode(errors='replace'))
|
log.error(e.stderr.decode(errors='replace'))
|
||||||
raise SubprocessOutputError('Ghostscript rasterizing failed') from e
|
Path(output_file).unlink(missing_ok=True)
|
||||||
else:
|
raise SubprocessOutputError("Ghostscript rasterizing failed") from e
|
||||||
stderr = p.stderr.decode(errors='replace')
|
|
||||||
if _gs_error_reported(stderr):
|
stderr = p.stderr.decode(errors='replace')
|
||||||
log.error(stderr)
|
if _gs_error_reported(stderr):
|
||||||
|
log.error(stderr)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with Image.open(BytesIO(p.stdout)) as im:
|
with Image.open(output_file) as im:
|
||||||
if rotation is not None:
|
if rotation is not None:
|
||||||
log.debug("Rotating output by %i", rotation)
|
log.debug("Rotating output by %i", rotation)
|
||||||
# rotation is a clockwise angle and Image.ROTATE_* is
|
# rotation is a clockwise angle and Image.ROTATE_* is
|
||||||
@@ -157,13 +158,19 @@ def rasterize_pdf(
|
|||||||
im = im.transpose(Image.Transpose.ROTATE_270)
|
im = im.transpose(Image.Transpose.ROTATE_270)
|
||||||
if rotation % 180 == 90:
|
if rotation % 180 == 90:
|
||||||
page_dpi = page_dpi.flip_axis()
|
page_dpi = page_dpi.flip_axis()
|
||||||
im.save(fspath(output_file), dpi=page_dpi)
|
im.save(output_file, dpi=page_dpi)
|
||||||
except UnidentifiedImageError:
|
except UnidentifiedImageError:
|
||||||
log.error(
|
log.error(
|
||||||
f"Ghostscript (using {raster_device} at {raster_dpi} dpi) produced "
|
f"Ghostscript (using {raster_device} at {raster_dpi} dpi) produced "
|
||||||
"an invalid page image file."
|
"an invalid page image file."
|
||||||
)
|
)
|
||||||
raise
|
raise
|
||||||
|
except OSError as e:
|
||||||
|
log.error(
|
||||||
|
f"Ghostscript (using {raster_device} at {raster_dpi} dpi) produced "
|
||||||
|
"an invalid page image file."
|
||||||
|
)
|
||||||
|
raise UnidentifiedImageError() from e
|
||||||
|
|
||||||
|
|
||||||
class GhostscriptFollower:
|
class GhostscriptFollower:
|
||||||
@@ -271,19 +278,15 @@ def generate_pdfa(
|
|||||||
f"-dPDFA={pdfa_part}",
|
f"-dPDFA={pdfa_part}",
|
||||||
"-dPDFACompatibilityPolicy=1",
|
"-dPDFACompatibilityPolicy=1",
|
||||||
"-o",
|
"-o",
|
||||||
"-",
|
fspath(output_file),
|
||||||
"-sstdout=%stderr", # Literal %s, not string interpolation
|
"-sstdout=%stderr", # Literal %s, not string interpolation
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
args_gs.extend(fspath(s) for s in pdf_pages) # Stringify Path objs
|
args_gs.extend(fspath(s) for s in pdf_pages) # Stringify Path objs
|
||||||
try:
|
try:
|
||||||
with (
|
with GhostscriptFollower(progressbar_class) as pbar:
|
||||||
Path(output_file).open('wb') as output,
|
|
||||||
GhostscriptFollower(progressbar_class) as pbar,
|
|
||||||
):
|
|
||||||
p = run_polling_stderr(
|
p = run_polling_stderr(
|
||||||
args_gs,
|
args_gs,
|
||||||
stdout=output,
|
|
||||||
stderr=PIPE,
|
stderr=PIPE,
|
||||||
check=True,
|
check=True,
|
||||||
text=True,
|
text=True,
|
||||||
|
|||||||
@@ -26,5 +26,5 @@ class PageNumberFilter(logging.Filter):
|
|||||||
class RichLoggingHandler(RichHandler):
|
class RichLoggingHandler(RichHandler):
|
||||||
def __init__(self, console: Console, **kwargs):
|
def __init__(self, console: Console, **kwargs):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
console=console, show_level=False, show_time=False, markup=True, **kwargs
|
console=console, show_level=False, show_time=False, markup=False, **kwargs
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ def test_ghostscript_mandatory_color_conversion(resources, outpdf):
|
|||||||
|
|
||||||
def test_rasterize_pdf_errors(resources, no_outpdf, caplog):
|
def test_rasterize_pdf_errors(resources, no_outpdf, caplog):
|
||||||
with patch('ocrmypdf._exec.ghostscript.run') as mock:
|
with patch('ocrmypdf._exec.ghostscript.run') as mock:
|
||||||
# ghostscript can produce
|
# ghostscript can produce empty files with return code 0
|
||||||
mock.return_value = subprocess.CompletedProcess(
|
mock.return_value = subprocess.CompletedProcess(
|
||||||
['fakegs'], returncode=0, stdout=b'', stderr=b'error this is an error'
|
['fakegs'], returncode=0, stdout=b'', stderr=b'error this is an error'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
import hypothesis
|
|
||||||
import pytest
|
|
||||||
Reference in New Issue
Block a user