Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d5fa05a00 | ||
|
|
997380e567 | ||
|
|
2685f910b1 | ||
|
|
bfcc586032 | ||
|
|
2d77b95fd9 |
@@ -21,7 +21,7 @@ These platforms have one-liner installs:
|
|||||||
+-------------------------------+-----------------------------------------+
|
+-------------------------------+-----------------------------------------+
|
||||||
| Windows Subsystem for Linux | ``apt install ocrmypdf`` |
|
| Windows Subsystem for Linux | ``apt install ocrmypdf`` |
|
||||||
+-------------------------------+-----------------------------------------+
|
+-------------------------------+-----------------------------------------+
|
||||||
| Fedora | ``dnf install ocrmypdf`` |
|
| Fedora | ``dnf install ocrmypdf tesseract-osd`` |
|
||||||
+-------------------------------+-----------------------------------------+
|
+-------------------------------+-----------------------------------------+
|
||||||
| macOS | ``brew install ocrmypdf`` |
|
| macOS | ``brew install ocrmypdf`` |
|
||||||
+-------------------------------+-----------------------------------------+
|
+-------------------------------+-----------------------------------------+
|
||||||
@@ -121,7 +121,7 @@ Users of Fedora 29 or later may simply
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
dnf install ocrmypdf
|
dnf install ocrmypdf tesseract-osd
|
||||||
|
|
||||||
For full details on version availability, check the `Fedora Package
|
For full details on version availability, check the `Fedora Package
|
||||||
Tracker <https://apps.fedoraproject.org/packages/ocrmypdf>`__.
|
Tracker <https://apps.fedoraproject.org/packages/ocrmypdf>`__.
|
||||||
@@ -293,7 +293,7 @@ Homebrew
|
|||||||
|
|
||||||
.. image:: https://img.shields.io/homebrew/v/ocrmypdf.svg
|
.. image:: https://img.shields.io/homebrew/v/ocrmypdf.svg
|
||||||
:alt: homebrew
|
:alt: homebrew
|
||||||
:target: http://brewformulas.org/Ocrmypdf
|
:target: https://formulae.brew.sh/formula/ocrmypdf
|
||||||
|
|
||||||
OCRmyPDF is now a standard `Homebrew <https://brew.sh>`__ formula. To
|
OCRmyPDF is now a standard `Homebrew <https://brew.sh>`__ formula. To
|
||||||
install on macOS:
|
install on macOS:
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ 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.3
|
||||||
|
=======
|
||||||
|
|
||||||
|
- Fixed :issue:`1068`, avoid deleting /dev/null when running as root.
|
||||||
|
- Other documentation fixes.
|
||||||
|
|
||||||
v14.0.2
|
v14.0.2
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -38,6 +38,7 @@ DESKEW = getenv_bool('OCR_DESKEW')
|
|||||||
OCR_JSON_SETTINGS = json.loads(os.getenv('OCR_JSON_SETTINGS', '{}'))
|
OCR_JSON_SETTINGS = json.loads(os.getenv('OCR_JSON_SETTINGS', '{}'))
|
||||||
POLL_NEW_FILE_SECONDS = int(os.getenv('OCR_POLL_NEW_FILE_SECONDS', '1'))
|
POLL_NEW_FILE_SECONDS = int(os.getenv('OCR_POLL_NEW_FILE_SECONDS', '1'))
|
||||||
USE_POLLING = getenv_bool('OCR_USE_POLLING')
|
USE_POLLING = getenv_bool('OCR_USE_POLLING')
|
||||||
|
RETRIES_LOADING_FILE = int(os.getenv('OCR_RETRIES_LOADING_FILE', '5'))
|
||||||
LOGLEVEL = os.getenv('OCR_LOGLEVEL', 'INFO')
|
LOGLEVEL = os.getenv('OCR_LOGLEVEL', 'INFO')
|
||||||
PATTERNS = ['*.pdf', '*.PDF']
|
PATTERNS = ['*.pdf', '*.PDF']
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ def wait_for_file_ready(file_path):
|
|||||||
# watchdog event before the file is actually fully on disk, causing
|
# watchdog event before the file is actually fully on disk, causing
|
||||||
# pikepdf to fail.
|
# pikepdf to fail.
|
||||||
|
|
||||||
retries = 5
|
retries = RETRIES_LOADING_FILE
|
||||||
while retries:
|
while retries:
|
||||||
try:
|
try:
|
||||||
pdf = pikepdf.open(file_path)
|
pdf = pikepdf.open(file_path)
|
||||||
@@ -142,6 +143,7 @@ def main():
|
|||||||
f"DESKEW: {DESKEW}\n"
|
f"DESKEW: {DESKEW}\n"
|
||||||
f"ARGS: {OCR_JSON_SETTINGS}\n"
|
f"ARGS: {OCR_JSON_SETTINGS}\n"
|
||||||
f"POLL_NEW_FILE_SECONDS: {POLL_NEW_FILE_SECONDS}\n"
|
f"POLL_NEW_FILE_SECONDS: {POLL_NEW_FILE_SECONDS}\n"
|
||||||
|
f"RETRIES_LOADING_FILE: {RETRIES_LOADING_FILE}\n"
|
||||||
f"USE_POLLING: {USE_POLLING}\n"
|
f"USE_POLLING: {USE_POLLING}\n"
|
||||||
f"LOGLEVEL: {LOGLEVEL}"
|
f"LOGLEVEL: {LOGLEVEL}"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ def is_file_writable(test_file: os.PathLike) -> bool:
|
|||||||
p = p.resolve(strict=False)
|
p = p.resolve(strict=False)
|
||||||
|
|
||||||
# p.is_file() throws an exception in some cases
|
# p.is_file() throws an exception in some cases
|
||||||
if p.exists() and p.is_file():
|
if p.exists() and (p.is_file() or p.samefile(os.devnull)):
|
||||||
return os.access(
|
return os.access(
|
||||||
os.fspath(p),
|
os.fspath(p),
|
||||||
os.W_OK,
|
os.W_OK,
|
||||||
|
|||||||
Reference in New Issue
Block a user