File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -257,11 +257,13 @@ def test_1645():
257257 )
258258 doc .save (path_out , garbage = 1 , deflate = True , no_new_id = True )
259259 print (f'Have created { path_out } . comparing with { path_expected } .' )
260- with open ( path_out , 'rb' ) as f :
261- out = f .read ()
262- with open ( path_expected , 'rb' ) as f :
263- expected = f .read ()
264- assert out == expected , f'Files differ: { path_out } { path_expected } '
260+ with pymupdf .open (path_expected ) as doc_expected , pymupdf .open (path_out ) as doc_out :
261+ rms = gentle_compare .pixmaps_rms (
262+ doc_expected [0 ].get_pixmap (),
263+ doc_out [0 ].get_pixmap (),
264+ )
265+ print (f'test_1645: { rms = } ' )
266+ assert rms < 0.1 , f'Pixmaps differ: { path_expected = } { path_out = } '
265267 finally :
266268 # Restore annot_stem.
267269 pymupdf .TOOLS .set_annot_stem (annot_stem )
You can’t perform that action at this time.
0 commit comments