3
0
Fork 0
forked from mirrors/nixpkgs

python310Packages.ocrmypdf: 13.6.0 -> 13.7.0

https://github.com/ocrmypdf/OCRmyPDF/blob/v13.7.0/docs/release_notes.rst
This commit is contained in:
Robert Schütz 2022-08-10 09:09:08 +00:00
parent cea179eb81
commit 23baa671f8
2 changed files with 23 additions and 23 deletions

View file

@ -27,7 +27,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "ocrmypdf"; pname = "ocrmypdf";
version = "13.6.0"; version = "13.7.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ocrmypdf"; owner = "ocrmypdf";
@ -39,7 +39,7 @@ buildPythonPackage rec {
postFetch = '' postFetch = ''
rm "$out/.git_archival.txt" rm "$out/.git_archival.txt"
''; '';
hash = "sha256-EY0dXma6tyXLT8XogS5iFdVgJPrtwB9YVrplhDT4gWw="; hash = "sha256-cw2wZMPhWzxRpeM90g9NmuYBYpU13R2iDzs7a8SS/CY=";
}; };
SETUPTOOLS_SCM_PRETEND_VERSION = version; SETUPTOOLS_SCM_PRETEND_VERSION = version;

View file

@ -1,8 +1,8 @@
diff --git a/src/ocrmypdf/_exec/ghostscript.py b/src/ocrmypdf/_exec/ghostscript.py diff --git a/src/ocrmypdf/_exec/ghostscript.py b/src/ocrmypdf/_exec/ghostscript.py
index 4da65483..af750249 100644 index 9e21c33c..21f134b3 100644
--- a/src/ocrmypdf/_exec/ghostscript.py --- a/src/ocrmypdf/_exec/ghostscript.py
+++ b/src/ocrmypdf/_exec/ghostscript.py +++ b/src/ocrmypdf/_exec/ghostscript.py
@@ -35,15 +35,7 @@ log = logging.getLogger(__name__) @@ -32,15 +32,7 @@ log = logging.getLogger(__name__)
# Most reliable what to get the bitness of Python interpreter, according to Python docs # Most reliable what to get the bitness of Python interpreter, according to Python docs
_IS_64BIT = sys.maxsize > 2**32 _IS_64BIT = sys.maxsize > 2**32
@ -20,10 +20,10 @@ index 4da65483..af750249 100644
def version(): def version():
diff --git a/src/ocrmypdf/_exec/jbig2enc.py b/src/ocrmypdf/_exec/jbig2enc.py diff --git a/src/ocrmypdf/_exec/jbig2enc.py b/src/ocrmypdf/_exec/jbig2enc.py
index 2e8a058b..65a09088 100644 index 0f8f7392..db792b10 100644
--- a/src/ocrmypdf/_exec/jbig2enc.py --- a/src/ocrmypdf/_exec/jbig2enc.py
+++ b/src/ocrmypdf/_exec/jbig2enc.py +++ b/src/ocrmypdf/_exec/jbig2enc.py
@@ -14,7 +14,7 @@ from ocrmypdf.subprocess import get_version, run @@ -12,7 +12,7 @@ from ocrmypdf.subprocess import get_version, run
def version(): def version():
@ -32,7 +32,7 @@ index 2e8a058b..65a09088 100644
def available(): def available():
@@ -27,7 +27,7 @@ def available(): @@ -25,7 +25,7 @@ def available():
def convert_group(*, cwd, infiles, out_prefix): def convert_group(*, cwd, infiles, out_prefix):
args = [ args = [
@ -41,7 +41,7 @@ index 2e8a058b..65a09088 100644
'-b', '-b',
out_prefix, out_prefix,
'-s', # symbol mode (lossy) '-s', # symbol mode (lossy)
@@ -46,7 +46,7 @@ def convert_group_mp(args): @@ -44,7 +44,7 @@ def convert_group_mp(args):
def convert_single(*, cwd, infile, outfile): def convert_single(*, cwd, infile, outfile):
@ -51,10 +51,10 @@ index 2e8a058b..65a09088 100644
proc = run(args, cwd=cwd, stdout=fstdout, stderr=PIPE) proc = run(args, cwd=cwd, stdout=fstdout, stderr=PIPE)
proc.check_returncode() proc.check_returncode()
diff --git a/src/ocrmypdf/_exec/pngquant.py b/src/ocrmypdf/_exec/pngquant.py diff --git a/src/ocrmypdf/_exec/pngquant.py b/src/ocrmypdf/_exec/pngquant.py
index ca8a4542..d0544174 100644 index 64e91139..ab5b9c49 100644
--- a/src/ocrmypdf/_exec/pngquant.py --- a/src/ocrmypdf/_exec/pngquant.py
+++ b/src/ocrmypdf/_exec/pngquant.py +++ b/src/ocrmypdf/_exec/pngquant.py
@@ -19,7 +19,7 @@ from ocrmypdf.subprocess import get_version, run @@ -17,7 +17,7 @@ from ocrmypdf.subprocess import get_version, run
def version(): def version():
@ -63,7 +63,7 @@ index ca8a4542..d0544174 100644
def available(): def available():
@@ -46,7 +46,7 @@ def input_as_png(input_file: Path): @@ -44,7 +44,7 @@ def input_as_png(input_file: Path):
def quantize(input_file: Path, output_file: Path, quality_min: int, quality_max: int): def quantize(input_file: Path, output_file: Path, quality_min: int, quality_max: int):
with input_as_png(input_file) as input_stream: with input_as_png(input_file) as input_stream:
args = [ args = [
@ -73,10 +73,10 @@ index ca8a4542..d0544174 100644
'--skip-if-larger', '--skip-if-larger',
'--quality', '--quality',
diff --git a/src/ocrmypdf/_exec/tesseract.py b/src/ocrmypdf/_exec/tesseract.py diff --git a/src/ocrmypdf/_exec/tesseract.py b/src/ocrmypdf/_exec/tesseract.py
index 01177cac..665f1145 100644 index ad98836a..a12d3002 100644
--- a/src/ocrmypdf/_exec/tesseract.py --- a/src/ocrmypdf/_exec/tesseract.py
+++ b/src/ocrmypdf/_exec/tesseract.py +++ b/src/ocrmypdf/_exec/tesseract.py
@@ -114,7 +114,7 @@ class TesseractVersion(Version): @@ -111,7 +111,7 @@ class TesseractVersion(Version):
def version() -> str: def version() -> str:
@ -84,8 +84,8 @@ index 01177cac..665f1145 100644
+ return get_version('@tesseract@', regex=r'tesseract\s(.+)') + return get_version('@tesseract@', regex=r'tesseract\s(.+)')
def has_user_words(): def has_user_words() -> bool:
@@ -141,7 +141,7 @@ def get_languages(): @@ -138,7 +138,7 @@ def get_languages() -> set[str]:
msg += output msg += output
return msg return msg
@ -94,20 +94,20 @@ index 01177cac..665f1145 100644
try: try:
proc = run( proc = run(
args_tess, args_tess,
@@ -163,7 +163,7 @@ def get_languages(): @@ -160,7 +160,7 @@ def get_languages() -> set[str]:
def tess_base_args(langs: List[str], engine_mode: Optional[int]) -> List[str]: def tess_base_args(langs: list[str], engine_mode: int | None) -> list[str]:
- args = ['tesseract'] - args = ['tesseract']
+ args = ['@tesseract@'] + args = ['@tesseract@']
if langs: if langs:
args.extend(['-l', '+'.join(langs)]) args.extend(['-l', '+'.join(langs)])
if engine_mode is not None: if engine_mode is not None:
diff --git a/src/ocrmypdf/_exec/unpaper.py b/src/ocrmypdf/_exec/unpaper.py diff --git a/src/ocrmypdf/_exec/unpaper.py b/src/ocrmypdf/_exec/unpaper.py
index 479959ef..cc15fdec 100644 index d7f24265..d14f85de 100644
--- a/src/ocrmypdf/_exec/unpaper.py --- a/src/ocrmypdf/_exec/unpaper.py
+++ b/src/ocrmypdf/_exec/unpaper.py +++ b/src/ocrmypdf/_exec/unpaper.py
@@ -69,7 +69,7 @@ class UnpaperImageTooLargeError(Exception): @@ -66,7 +66,7 @@ class UnpaperImageTooLargeError(Exception):
def version() -> str: def version() -> str:
@ -115,13 +115,13 @@ index 479959ef..cc15fdec 100644
+ return get_version('@unpaper@') + return get_version('@unpaper@')
SUFFIXES = {'1': '.pbm', 'L': '.pgm', 'RGB': '.ppm'} SUPPORTED_MODES = {'1', 'L', 'RGB'}
@@ -123,7 +123,7 @@ def _setup_unpaper_io(input_file: Path) -> Iterator[Tuple[Path, Path, Path]]: @@ -120,7 +120,7 @@ def _setup_unpaper_io(input_file: Path) -> Iterator[tuple[Path, Path, Path]]:
def run_unpaper( def run_unpaper(
input_file: Path, output_file: Path, *, dpi: DecFloat, mode_args: List[str] input_file: Path, output_file: Path, *, dpi: DecFloat, mode_args: list[str]
) -> None: ) -> None:
- args_unpaper = ['unpaper', '-v', '--dpi', str(round(dpi, 6))] + mode_args - args_unpaper = ['unpaper', '-v', '--dpi', str(round(dpi, 6))] + mode_args
+ args_unpaper = ['@unpaper@', '-v', '--dpi', str(round(dpi, 6))] + mode_args + args_unpaper = ['@unpaper@', '-v', '--dpi', str(round(dpi, 6))] + mode_args
with _setup_unpaper_io(input_file) as (input_pnm, output_pnm, tmpdir): with _setup_unpaper_io(input_file) as (input_png, output_pnm, tmpdir):
# To prevent any shenanigans from accepting arbitrary parameters in # To prevent any shenanigans from accepting arbitrary parameters in