Compare commits

...
18 Commits
Author SHA1 Message Date
James R. Barlow f072e91120 v14.0.2 2023-01-03 17:07:53 -08:00
James R. Barlow efa2bca8a3 Github Actions ignores ||, force it to do the right thing 2023-01-03 14:51:09 -08:00
James R. Barlow b039010d3e Ignore brew update errors 2023-01-03 14:36:21 -08:00
James R. Barlow 3f7cefcf5d macos - drop Python 3.10 since homebrew is having trouble 2023-01-02 13:08:42 -08:00
James R. Barlow 45f97d1565 macos build: brew first? 2023-01-02 12:36:28 -08:00
James R. Barlow 1281f8eb68 Workaround 2to3 linking error in macos build 2023-01-02 01:10:20 -08:00
James R. Barlow 9ef61864fb Update Python versions 2023-01-01 19:13:50 -08:00
James R. Barlow 90b2119ad3 pdfinfo: skip null FormX entries 2023-01-01 16:58:14 -08:00
James R. Barlow f0cc7f2230 docs: explicitly end win32 support 2023-01-01 16:58:14 -08:00
M.Yasoob Ullah Khalid ☺andGitHub d60a384aab Fixed the source installation instructions (#1048) 2022-12-22 02:54:53 -08:00
James R. Barlow 14a6093636 Remove old issue templates 2022-12-14 17:33:00 -08:00
James R. Barlow 54b42d73ab Merge remote-tracking branch 'origin/master' 2022-12-14 17:31:56 -08:00
M.Yasoob Ullah Khalid ☺andGitHub 9abed14f1f fixed interchanged words (#1039) 2022-12-14 17:24:55 -08:00
Doug RinckesandGitHub d09f61d4fe log completion message (#1044)
This logs the "done" message if neither delete nor archive options are set.
2022-12-14 17:24:41 -08:00
M.Yasoob Ullah Khalid ☺andGitHub 4a0130649e Fixed some wording (#1045) 2022-12-14 17:24:22 -08:00
jbarlow83andGitHub a0224d94ca Update issue templates 2022-12-14 17:23:57 -08:00
Carlos GarcésandGitHub 9e7b9de830 Fix tesseract documentation url (#1047) 2022-12-14 11:58:21 -08:00
James R. Barlow 08fc5fc01d Fix issue templates - Github doesn't support comments above 2022-10-24 14:55:08 -07:00
12 changed files with 41 additions and 38 deletions
@@ -1,5 +1,3 @@
# SPDX-FileCopyrightText: 2022 James R. Barlow
# SPDX-License-Identifier: CC-BY-SA-4.0
--- ---
name: Feature request name: Feature request
about: Suggest an idea for this project about: Suggest an idea for this project
@@ -19,11 +17,7 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered. Please include the versions of OCRmyPDF and other supporting programs (Tesseract OCR, Ghostscript) - maybe an alternative already exists in a newer version. A clear and concise description of any alternative solutions or features you've considered. Please include the versions of OCRmyPDF and other supporting programs (Tesseract OCR, Ghostscript) - maybe an alternative already exists in a newer version.
**Example file** **Example file**
If your issue concerns how OCRmyPDF processes certain files, and please provide an example file that helps illustrate how OCRmyPDF's output could be improve. If your issue concerns how OCRmyPDF processes certain files, and please provide an example file that helps illustrate how OCRmyPDF's output could be improve. You could also look in ``tests/resources`` and see if any of those files demonstrates your issue.
Please provide an input file with no personal or confidential information. At your option you may [GPG-encrypt the file](https://github.com/ocrmypdf/OCRmyPDF/wiki) for OCRmyPDF's author only.
Links to files hosted elsewhere are perfectly acceptable. You could also look in ``tests/resources`` and see if any of those files reproduce your issue.
**Additional context** **Additional context**
Add any other context or screenshots about the feature request here. Add any other context or screenshots about the feature request here.
@@ -1,9 +1,7 @@
# SPDX-FileCopyrightText: 2022 James R. Barlow
# SPDX-License-Identifier: CC-BY-SA-4.0
--- ---
name: General issues name: General issues
about: Installation, packages, dependencies, "nothing works", test suite failures... about: Installation, packages, dependencies, "nothing works", test suite failures...
title: '' title: "[BUG]"
labels: '' labels: ''
assignees: '' assignees: ''
@@ -25,6 +23,7 @@ If applicable, add screenshots to help explain your problem.
- OS: - OS:
- Python version: - Python version:
- OCRmyPDF version: - OCRmyPDF version:
- Platform: x64 or ARM
**Installation** **Installation**
How did you install OCRmyPDF? Did you install it from your operating system's How did you install OCRmyPDF? Did you install it from your operating system's
@@ -1,9 +1,7 @@
# SPDX-FileCopyrightText: 2022 James R. Barlow
# SPDX-License-Identifier: CC-BY-SA-4.0
--- ---
name: Problem with a specific input file name: Problem with specific file
about: Something went wrong while trying to OCR a specific file about: Something went wrong while trying to OCR a specific file
title: '' title: "[BUG]"
labels: '' labels: ''
assignees: '' assignees: ''
+9 -8
View File
@@ -33,7 +33,7 @@ jobs:
- os: ubuntu-latest - os: ubuntu-latest
python: "3.10" python: "3.10"
- os: ubuntu-latest - os: ubuntu-latest
python: "3.11.0-rc.2 - 3.11.0" python: "3.11"
# - os: ubuntu-latest # - os: ubuntu-latest
# python: "pypy3.8" # python: "pypy3.8"
#- os: ubuntu-latest #- os: ubuntu-latest
@@ -122,7 +122,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [macos-latest] os: [macos-latest]
python: ["3.9", "3.10"] # 2022-09-20: pikepdf/lxml not available for cp311 python: ["3.10", "3.11"]
env: env:
OS: ${{ matrix.os }} OS: ${{ matrix.os }}
@@ -133,12 +133,8 @@ jobs:
with: with:
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
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{ matrix.python }}
- name: Install Homebrew deps - name: Install Homebrew deps
continue-on-error: true
run: | run: |
brew update brew update
brew install \ brew install \
@@ -149,6 +145,11 @@ jobs:
pngquant \ pngquant \
tesseract tesseract
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{ matrix.python }}
- name: Install Python packages - name: Install Python packages
run: | run: |
python -m pip install --upgrade pip wheel python -m pip install --upgrade pip wheel
@@ -177,7 +178,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [windows-latest] os: [windows-latest]
python: ["3.9", "3.10"] # 2022-09-20: pikepdf/lxml not available for cp311 python: ["3.10", "3.11"]
env: env:
OS: ${{ matrix.os }} OS: ${{ matrix.os }}
+1
View File
@@ -16,6 +16,7 @@ Copyright: (C) 2022 James R. Barlow
License: MPL-2.0 License: MPL-2.0
Files: Files:
.github/ISSUE_TEMPLATE/*.md
docs/images/macos-workflow.png docs/images/macos-workflow.png
Copyright: (C) 2022 James R. Barlow Copyright: (C) 2022 James R. Barlow
License: CC-BY-SA-4.0 License: CC-BY-SA-4.0
+1 -1
View File
@@ -160,7 +160,7 @@ Changing tesseract configuration variables
------------------------------------------ ------------------------------------------
You can override tesseract's default `control You can override tesseract's default `control
parameters <https://github.com/tesseract-ocr/tesseract/wiki/ControlParams>`__ parameters <https://tesseract-ocr.github.io/tessdoc/tess3/ControlParams.html>`__
with a configuration file. with a configuration file.
As an example, this configuration will disable Tesseract's dictionary As an example, this configuration will disable Tesseract's dictionary
+2 -2
View File
@@ -21,8 +21,8 @@ processors. To maximize parallelism without overloading your system with
processes, consider using ``parallel -j 2`` to limit parallel to running processes, consider using ``parallel -j 2`` to limit parallel to running
two jobs at once. two jobs at once.
This command will run all ocrmypdf all files named ``*.pdf`` in the This command will run ``ocrmypdf`` on all files named ``*.pdf`` in the
current directory and write them to the previous created ``output/`` current directory and write them to the previously created ``output/``
folder. It will not search subdirectories. folder. It will not search subdirectories.
The ``--tag`` argument tells parallel to print the filename as a prefix The ``--tag`` argument tells parallel to print the filename as a prefix
+9 -7
View File
@@ -375,8 +375,8 @@ Native Windows
You must install the following for Windows: You must install the following for Windows:
* Python 3.8 (64-bit) or later * Python 3.8 (64-bit) or later
* Tesseract 4.1.1 or later * Tesseract 4.1.1 (64-bit) or later
* Ghostscript 9.50 or later * Ghostscript 9.50 (64-bit) or later
Using the `Chocolatey <https://chocolatey.org/>`_ package manager, install the Using the `Chocolatey <https://chocolatey.org/>`_ package manager, install the
following when running in an Administrator command prompt: following when running in an Administrator command prompt:
@@ -395,10 +395,8 @@ Administrator.):
* ``pip install ocrmypdf`` * ``pip install ocrmypdf``
Chocolatey automatically selects appropriate versions of these applications. If you Chocolatey automatically selects appropriate versions of these applications. Please make sure
are installing them manually, please install 64-bit versions of all applications for you are installing the 64-bit versions.
64-bit Windows, or 32-bit versions of all applications for 32-bit Windows. Mixing
the "bitness" of these programs will lead to errors.
OCRmyPDF will check the Windows Registry and standard locations in your Program Files OCRmyPDF will check the Windows Registry and standard locations in your Program Files
for third party software it needs (specifically, Tesseract and Ghostscript). To for third party software it needs (specifically, Tesseract and Ghostscript). To
@@ -413,6 +411,10 @@ to change the PATH.
Please download Python from Python.org or Chocolatey instead, and do not use the Please download Python from Python.org or Chocolatey instead, and do not use the
Microsoft Store version. Microsoft Store version.
.. warning::
32-bit Windows might work, but is not supported.
Windows Subsystem for Linux Windows Subsystem for Linux
--------------------------- ---------------------------
@@ -636,7 +638,7 @@ system-wide:
.. code-block:: bash .. code-block:: bash
git clone -b master https://github.com/ocrmypdf/OCRmyPDF.git git clone -b master https://github.com/ocrmypdf/OCRmyPDF.git
python3 -m venv python3 -m venv venv
source venv/bin/activate source venv/bin/activate
cd OCRmyPDF cd OCRmyPDF
pip install . pip install .
+1 -1
View File
@@ -85,7 +85,7 @@ OCRmyPDF analyzes each page of a PDF to determine the colorspace and
resolution (DPI) needed to capture all of the information on that page resolution (DPI) needed to capture all of the information on that page
without losing content. It uses without losing content. It uses
`Ghostscript <http://ghostscript.com/>`__ to rasterize the page, and `Ghostscript <http://ghostscript.com/>`__ to rasterize the page, and
then performs on OCR the rasterized image to create an OCR "layer". then performs OCR on the rasterized image to create an OCR "layer".
The layer is then grafted back onto the original PDF. The layer is then grafted back onto the original PDF.
While one can use a program like Ghostscript or ImageMagick to get an While one can use a program like Ghostscript or ImageMagick to get an
+8
View File
@@ -28,6 +28,14 @@ tagged yet.
.. |OCRmyPDF PyPI| image:: https://img.shields.io/pypi/v/ocrmypdf.svg .. |OCRmyPDF PyPI| image:: https://img.shields.io/pypi/v/ocrmypdf.svg
v14.0.2
=======
- Fixed :issue:`1052`, an exception on attempting to process certain nonconforming PDFs.
- Explicitly documented that Windows 32-bit is no longer supported.
- Fixed source installation instructions.
- Other documentation fixes.
v14.0.1 v14.0.1
======= =======
+2
View File
@@ -103,6 +103,8 @@ def execute_ocrmypdf(file_path):
elif ON_SUCCESS_ARCHIVE: elif ON_SUCCESS_ARCHIVE:
log.info(f'OCR is done. Archiving {file_path.name} to {ARCHIVE_DIRECTORY}') log.info(f'OCR is done. Archiving {file_path.name} to {ARCHIVE_DIRECTORY}')
shutil.move(file_path, f'{ARCHIVE_DIRECTORY}/{file_path.name}') shutil.move(file_path, f'{ARCHIVE_DIRECTORY}/{file_path.name}')
else:
log.info('OCR is done')
else: else:
log.info('OCR is done') log.info('OCR is done')
+3 -5
View File
@@ -477,14 +477,12 @@ def _image_xobjects(container) -> Iterator[tuple[Object, str]]:
resources = container['/Resources'] resources = container['/Resources']
if '/XObject' not in resources: if '/XObject' not in resources:
return return
xobjs = resources['/XObject'].as_dict() for key, candidate in resources['/XObject'].items():
for xobj in xobjs: if candidate is None or '/Subtype' not in candidate:
candidate: Object = xobjs[xobj]
if '/Subtype' not in candidate:
continue continue
if candidate['/Subtype'] == '/Image': if candidate['/Subtype'] == '/Image':
pdfimage = candidate pdfimage = candidate
yield (pdfimage, xobj) yield (pdfimage, key)
def _find_regular_images( def _find_regular_images(