Skip to content

Commit 576a576

Browse files
tests/: added test_3994().
1 parent ebdb8ba commit 576a576

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/resources/test_3994.pdf

254 KB
Binary file not shown.

tests/test_pixmap.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,15 @@ def test_3848():
376376
rect = annot['rect']
377377
pixmap = page.get_pixmap(clip=rect)
378378
color_bytes = pixmap.color_topusage()
379+
380+
381+
def test_3994():
382+
path = os.path.normpath(f'{__file__}/../../tests/resources/test_3994.pdf')
383+
with pymupdf.open(path) as document:
384+
page = document[0]
385+
txt_blocks = [blk for blk in page.get_text('dict')['blocks'] if blk['type']==0]
386+
for blk in txt_blocks:
387+
pix = page.get_pixmap(clip=pymupdf.Rect([int(v) for v in blk['bbox']]), colorspace=pymupdf.csRGB, alpha=False)
388+
percent, color = pix.color_topusage()
389+
wt = pymupdf.TOOLS.mupdf_warnings()
390+
assert wt == 'premature end of data in flate filter\n... repeated 2 times...'

0 commit comments

Comments
 (0)