PyMuPDF 1.23.15__tar.gz → 1.23.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/PKG-INFO +1 -1
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/changes.txt +14 -1
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/scripts/sysinstall.py +1 -1
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/setup.py +1 -1
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src/__init__.py +8 -6
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src/table.py +18 -10
- PyMuPDF-1.23.16/src_classic/version.i +7 -0
- PyMuPDF-1.23.16/tests/resources/test_3058.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_pixmap.py +28 -0
- PyMuPDF-1.23.15/src_classic/version.i +0 -7
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/COPYING +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/MANIFEST.in +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/README.md +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/READMErb.md +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/mupdf.tgz +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/pipcl.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/pyproject.toml +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/pytest.ini +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/scripts/gh_release.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/scripts/test.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src/__main__.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src/extra.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src/fitz.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src/utils.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/__init__.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/__main__.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/_config.h +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/fitz_old.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-annot.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-convert.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-defines.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-devices.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-fields.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-fileobj.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-geo-c.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-geo-py.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-globals.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-other.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-pdfinfo.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-pixmap.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-portfolio.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-python.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-select.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-stext.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/helper-xobject.i +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/src_classic/utils.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/README.md +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/001003ED.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/1.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/2.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/2201.00069.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/3.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/4.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/Bezier.epub +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/PragmaticaC.otf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/bug1945.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/bug1971.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/chinese-tables.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/chinese-tables.pickle +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/circular-toc.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/cython.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/cython.pickle +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/full_toc.txt +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/full_toc2.txt +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/github_sample.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/has-bad-fonts.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/image-file1.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/img-transparent.png +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/joined.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/metadata.txt +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/mupdf_explored.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/nur-ruhig.jpg +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/quad-calc-0.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/simple_toc.txt +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/symbol-list.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/symbols.txt +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test-2333.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test-2462.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test2093.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test2182.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test2238.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_1645_expected.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_1645_expected_1.22.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_1824.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2108.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2270.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2533.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2548.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2553-2.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2553.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2596.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2608_expected +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2634.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2635.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2645_1.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2645_2.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2645_3.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2710.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2730.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2788.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2791_content.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2791_coverpage.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2861.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2871.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2904.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2907.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2954.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2957_1.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2957_2.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2969.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_2979.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/test_delete_image.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/type3font.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/v110-changes.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/resources/widgettest.pdf +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/run_compound.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_2548.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_2634.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_2791.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_2904.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_2907.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_annots.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_badfonts.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_crypting.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_docs_samples.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_drawings.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_embeddedfiles.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_extractimage.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_flake8.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_font.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_general.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_geometry.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_imagebbox.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_insertimage.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_insertpdf.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_linequad.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_metadata.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_named_links.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_nonpdf.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_object_manipulation.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_optional_content.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_pagedelete.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_pagelabels.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_showpdfpage.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_story.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_tables.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_tesseract.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_textbox.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_textextract.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_textsearch.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_toc.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_widgets.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/tests/test_word_delimiters.py +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/valgrind.supp +0 -0
- {PyMuPDF-1.23.15 → PyMuPDF-1.23.16}/wdev.py +0 -0
|
@@ -2,11 +2,24 @@ Change Log
|
|
|
2
2
|
==========
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
**Changes in version 1.23.16 (2024-01-18)**
|
|
6
|
+
|
|
7
|
+
* Bug fixes:
|
|
8
|
+
|
|
9
|
+
* **Fixed** `3058 <https://github.com/pymupdf/PyMuPDF/issues/3058>`_: Pixmap created from CMYK JPEG delivers RGB format
|
|
10
|
+
|
|
11
|
+
* Other:
|
|
12
|
+
|
|
13
|
+
* In table detection strategy "lines_strict", exclude fill-only vector graphics.
|
|
14
|
+
* Fixed sysinstall test failure.
|
|
15
|
+
* In documentation, update feature matrix with item about text writing.
|
|
16
|
+
|
|
17
|
+
|
|
5
18
|
**Changes in version 1.23.15 (2024-01-16)**
|
|
6
19
|
|
|
7
20
|
* Bug fixes:
|
|
8
21
|
|
|
9
|
-
* **Fixed** `
|
|
22
|
+
* **Fixed** `3050 <https://github.com/pymupdf/PyMuPDF/issues/3050>`_: python3.9 pix.set_pixel has something wrong in c.append( ord(i))
|
|
10
23
|
|
|
11
24
|
* Other:
|
|
12
25
|
|
|
@@ -291,7 +291,7 @@ def main():
|
|
|
291
291
|
# PyMuPDF.
|
|
292
292
|
command = f'. {test_venv}/bin/activate'
|
|
293
293
|
command += f' && LD_LIBRARY_PATH={root_prefix}/lib PYTHONPATH={pythonpath}'
|
|
294
|
-
command += f' pytest -k "not test_color_count" {pymupdf_dir}'
|
|
294
|
+
command += f' pytest -k "not test_color_count and not test_3050" {pymupdf_dir}'
|
|
295
295
|
run(command)
|
|
296
296
|
|
|
297
297
|
|
|
@@ -2396,7 +2396,9 @@ class Colorspace:
|
|
|
2396
2396
|
|
|
2397
2397
|
def __init__(self, type_):
|
|
2398
2398
|
"""Supported are GRAY, RGB and CMYK."""
|
|
2399
|
-
if type_
|
|
2399
|
+
if isinstance( type_, mupdf.FzColorspace):
|
|
2400
|
+
self.this = type_
|
|
2401
|
+
elif type_ == CS_GRAY:
|
|
2400
2402
|
self.this = mupdf.FzColorspace(mupdf.FzColorspace.Fixed_GRAY)
|
|
2401
2403
|
elif type_ == CS_CMYK:
|
|
2402
2404
|
self.this = mupdf.FzColorspace(mupdf.FzColorspace.Fixed_CMYK)
|
|
@@ -7759,8 +7761,8 @@ class Page:
|
|
|
7759
7761
|
else:
|
|
7760
7762
|
pm = mupdf.fz_convert_pixmap(
|
|
7761
7763
|
arg_pix,
|
|
7762
|
-
mupdf.FzColorspace(
|
|
7763
|
-
mupdf.FzColorspace(
|
|
7764
|
+
mupdf.FzColorspace(),
|
|
7765
|
+
mupdf.FzColorspace(),
|
|
7764
7766
|
mupdf.FzDefaultColorspaces(None),
|
|
7765
7767
|
mupdf.FzColorParams(),
|
|
7766
7768
|
1,
|
|
@@ -9429,7 +9431,7 @@ class Pixmap:
|
|
|
9429
9431
|
self.this = mupdf.fz_convert_pixmap(
|
|
9430
9432
|
spix,
|
|
9431
9433
|
cs,
|
|
9432
|
-
mupdf.FzColorspace(
|
|
9434
|
+
mupdf.FzColorspace(),
|
|
9433
9435
|
mupdf.FzDefaultColorspaces(None),
|
|
9434
9436
|
mupdf.FzColorParams(),
|
|
9435
9437
|
1
|
|
@@ -21754,8 +21756,8 @@ def int_rc(text):
|
|
|
21754
21756
|
return int(text)
|
|
21755
21757
|
|
|
21756
21758
|
VersionFitz = "1.23.9" # MuPDF version.
|
|
21757
|
-
VersionBind = "1.23.
|
|
21758
|
-
VersionDate = "2024-01-
|
|
21759
|
+
VersionBind = "1.23.16" # PyMuPDF version.
|
|
21760
|
+
VersionDate = "2024-01-18 00:00:01"
|
|
21759
21761
|
VersionDate2 = VersionDate.replace('-', '').replace(' ', '').replace(':', '')
|
|
21760
21762
|
version = (VersionBind, VersionFitz, VersionDate2)
|
|
21761
21763
|
pymupdf_version_tuple = tuple( [int_rc(i) for i in VersionBind.split('.')])
|
|
@@ -1886,8 +1886,24 @@ def make_edges(page, clip=None, tset=None):
|
|
|
1886
1886
|
|
|
1887
1887
|
parea = abs(page.rect) * 0.8 # area of the full page (80%)
|
|
1888
1888
|
|
|
1889
|
-
# exclude graphics
|
|
1890
|
-
paths = [
|
|
1889
|
+
# exclude irrelevant graphics
|
|
1890
|
+
paths = []
|
|
1891
|
+
for p in page.get_drawings():
|
|
1892
|
+
if abs(p["rect"]) >= parea:
|
|
1893
|
+
continue
|
|
1894
|
+
if "s" in p["type"]:
|
|
1895
|
+
paths.append(p)
|
|
1896
|
+
continue
|
|
1897
|
+
if (
|
|
1898
|
+
p["rect"].width > 3
|
|
1899
|
+
and p["rect"].height > 3
|
|
1900
|
+
and (
|
|
1901
|
+
tset.vertical_strategy == "lines_strict"
|
|
1902
|
+
or tset.horizontal_strategy == "lines_strict"
|
|
1903
|
+
)
|
|
1904
|
+
):
|
|
1905
|
+
continue
|
|
1906
|
+
paths.append(p)
|
|
1891
1907
|
|
|
1892
1908
|
# make a list of vector graphics rectangles (IRects are sufficient)
|
|
1893
1909
|
prects = sorted([p["rect"] for p in paths], key=lambda r: (r.y1, r.x0))
|
|
@@ -1998,14 +2014,6 @@ def make_edges(page, clip=None, tset=None):
|
|
|
1998
2014
|
return line_dict
|
|
1999
2015
|
|
|
2000
2016
|
for p in paths:
|
|
2001
|
-
if p["type"] == "f" and p["fill"] == (1, 1, 1):
|
|
2002
|
-
continue
|
|
2003
|
-
if p["type"] == "f" and p["rect"].width > 3 and p["rect"].height > 3:
|
|
2004
|
-
if (
|
|
2005
|
-
tset.vertical_strategy == "lines_strict"
|
|
2006
|
-
or tset.horizontal_strategy == "lines_strict"
|
|
2007
|
-
):
|
|
2008
|
-
continue
|
|
2009
2017
|
items = p["items"] # items in this path
|
|
2010
2018
|
|
|
2011
2019
|
# if 'closePath', add a line from last to first point
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
%pythoncode %{
|
|
2
|
+
VersionFitz = "1.23.9" # MuPDF version.
|
|
3
|
+
VersionBind = "1.23.16" # PyMuPDF version.
|
|
4
|
+
VersionDate = "2024-01-18 00:00:01"
|
|
5
|
+
version = (VersionBind, VersionFitz, "20240118000001")
|
|
6
|
+
pymupdf_version_tuple = tuple( [int(i) for i in VersionFitz.split('.')])
|
|
7
|
+
%}
|
|
Binary file
|
|
@@ -94,6 +94,10 @@ def test_setalpha():
|
|
|
94
94
|
assert t == alphas
|
|
95
95
|
|
|
96
96
|
def test_color_count():
|
|
97
|
+
'''
|
|
98
|
+
This is known to fail if MuPDF is built without PyMuPDF's custom config.h,
|
|
99
|
+
e.g. in Linux system installs.
|
|
100
|
+
'''
|
|
97
101
|
pm = fitz.Pixmap(imgfile)
|
|
98
102
|
assert pm.color_count() == 40624
|
|
99
103
|
|
|
@@ -154,6 +158,10 @@ def test_3020():
|
|
|
154
158
|
pm4 = fitz.Pixmap(pm, pm3)
|
|
155
159
|
|
|
156
160
|
def test_3050():
|
|
161
|
+
'''
|
|
162
|
+
This is known to fail if MuPDF is built without it's default third-party
|
|
163
|
+
libraries, e.g. in Linux system installs.
|
|
164
|
+
'''
|
|
157
165
|
pdf_file = fitz.open(pdf)
|
|
158
166
|
for page_no, page in enumerate(pdf_file):
|
|
159
167
|
zoom_x = 4.0
|
|
@@ -179,3 +187,23 @@ def test_3050():
|
|
|
179
187
|
pix.save(os.path.abspath(f'{__file__}/../../tests/test_3050_out.png'))
|
|
180
188
|
assert digest1 != digest0
|
|
181
189
|
assert digest1 == digest_expected
|
|
190
|
+
|
|
191
|
+
def test_3058():
|
|
192
|
+
doc = fitz.Document(os.path.abspath(f'{__file__}/../../tests/resources/test_3058.pdf'))
|
|
193
|
+
images = doc[0].get_images(full=True)
|
|
194
|
+
pix = fitz.Pixmap(doc, 17)
|
|
195
|
+
|
|
196
|
+
# First bug was that `pix.colorspace` was DeviceRGB.
|
|
197
|
+
assert str(pix.colorspace) == 'Colorspace(CS_CMYK) - DeviceCMYK'
|
|
198
|
+
|
|
199
|
+
pix = fitz.Pixmap(fitz.csRGB, pix)
|
|
200
|
+
assert str(pix.colorspace) == 'Colorspace(CS_RGB) - DeviceRGB'
|
|
201
|
+
|
|
202
|
+
# Second bug was that the image was converted to RGB via greyscale proofing
|
|
203
|
+
# color space, so image contained only shades of grey. This compressed
|
|
204
|
+
# easily to a .png file, so we crudely check the bug is fixed by looking at
|
|
205
|
+
# size of .png file.
|
|
206
|
+
path = os.path.abspath(f'{__file__}/../../tests/test_3058_out.png')
|
|
207
|
+
pix.save(path)
|
|
208
|
+
s = os.path.getsize(path)
|
|
209
|
+
assert 1800000 < s < 2600000, f'Unexpected size of {path}: {s}'
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
%pythoncode %{
|
|
2
|
-
VersionFitz = "1.23.9" # MuPDF version.
|
|
3
|
-
VersionBind = "1.23.15" # PyMuPDF version.
|
|
4
|
-
VersionDate = "2024-01-16 00:00:01"
|
|
5
|
-
version = (VersionBind, VersionFitz, "20240116000001")
|
|
6
|
-
pymupdf_version_tuple = tuple( [int(i) for i in VersionFitz.split('.')])
|
|
7
|
-
%}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|