Skip to content

Commit 088487a

Browse files
committed
Update test_3780 to avoid tripping on non-text blocks.
The test extracts text and images from a page. It drops any images that are not fully included within the mediabox. Accordingly the test never sees any images, so works fine. In a new MuPDF commit, when the CLIP flag is sent, images are restricted to the clip region - i.e. they always fit within the mediabox, hence we now have images appearing in the list. The fix is to skip any non-text blocks in the test.
1 parent fdc472b commit 088487a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tests/test_font.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ def test_3780():
206206
# print(f' {n}: {v!r}')
207207
for i, block in enumerate(d['blocks']):
208208
print(f'block {i}:')
209+
if block['type'] != 0:
210+
continue
209211
for j, line in enumerate(block['lines']):
210212
print(f' line {j}:')
211213
for k, span in enumerate(line['spans']):

0 commit comments

Comments
 (0)