Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pymupdf/PyMuPDF
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: pymupdf/PyMuPDF
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: jules-test
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Jan 22, 2024

  1. Reduce size of two very large test files.

    This reduces size of sdist from 100MB to 72MB.
    julian-smith-artifex-com committed Jan 22, 2024
    Copy the full SHA
    00e1052 View commit details
Showing with 7 additions and 7 deletions.
  1. BIN tests/resources/2201.00069.pdf
  2. BIN tests/resources/test_2904.pdf
  3. +3 −3 tests/test_2904.py
  4. +4 −4 tests/test_font.py
Binary file modified tests/resources/2201.00069.pdf
Binary file not shown.
Binary file modified tests/resources/test_2904.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions tests/test_2904.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ def test_2904():
for page_id, page in enumerate(pdf_docs):
page_imgs = page.get_images()
for i, img in enumerate(page_imgs):
if page_id == 75:
if page_id == 5:
#print(f'{page_id=} {i=} {type(img)=} {img=}')
sys.stdout.flush()
e = None
@@ -23,9 +23,9 @@ def test_2904():
fitz.exception_info()
sys.stdout.flush()
e = ee
if page_id == 75:
if page_id == 5:
print(f'{fitz.mupdf_version_tuple=}: {page_id=} {i=} {e=} {img=}:')
if page_id == 75 and i==3:
if page_id == 5 and i==3:
assert e
if hasattr(fitz, 'mupdf'):
# rebased.
8 changes: 4 additions & 4 deletions tests/test_font.py
Original file line number Diff line number Diff line change
@@ -43,13 +43,13 @@ def test_2608():
print( f'Not running test_2608 because mupdf too old: {fitz.mupdf_version_tuple=}')
return
flags = (fitz.TEXT_DEHYPHENATE | fitz.TEXT_MEDIABOX_CLIP)
with fitz.open(os.path.abspath(f'{__file__}/../resources/2201.00069.pdf')) as doc:
page = doc[4]
with fitz.open(os.path.abspath(f'{__file__}/../../tests/resources/2201.00069.pdf')) as doc:
page = doc[0]
blocks = page.get_text_blocks(flags=flags)
text = blocks[10][4]
with open(os.path.abspath(f'{__file__}/../test_2608_out'), 'wb') as f:
with open(os.path.abspath(f'{__file__}/../../tests/test_2608_out'), 'wb') as f:
f.write(text.encode('utf8'))
with open(os.path.abspath(f'{__file__}/../resources/test_2608_expected'), 'rb') as f:
with open(os.path.abspath(f'{__file__}/../../tests/resources/test_2608_expected'), 'rb') as f:
expected = f.read().decode('utf8')
# Github windows x32 seems to insert \r characters; maybe something to
# do with the Python installation's line endings settings.