File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 66"""
77
88import pymupdf
9+ import gentle_compare
910
1011import os
1112import platform
@@ -388,3 +389,21 @@ def test_3994():
388389 percent , color = pix .color_topusage ()
389390 wt = pymupdf .TOOLS .mupdf_warnings ()
390391 assert wt == 'premature end of data in flate filter\n ... repeated 2 times...'
392+
393+
394+ def test_3448 ():
395+ path = os .path .normpath (f'{ __file__ } /../../tests/resources/test_3448.pdf' )
396+ with pymupdf .open (path ) as document :
397+ page = document [0 ]
398+ pixmap = page .get_pixmap (alpha = False , dpi = 150 )
399+ path_out = f'{ path } .png'
400+ pixmap .save (path_out )
401+ print (f'Have written to: { path_out } ' )
402+ path_expected = os .path .normpath (f'{ __file__ } /../../tests/resources/test_3448.pdf-expected.png' )
403+ pixmap_expected = pymupdf .Pixmap (path_expected )
404+ diff = gentle_compare .pixmaps_rms (pixmap , pixmap_expected )
405+ print (f'{ diff = } ' )
406+ if pymupdf .mupdf_version_tuple < (1 , 25 ):
407+ assert 30 <= diff < 45
408+ else :
409+ assert 0 <= diff < 0.5
You can’t perform that action at this time.
0 commit comments