File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -550,3 +550,32 @@ def test_4423():
550550 assert not ee , f'Received unexpected exception: { e } '
551551 wt = pymupdf .TOOLS .mupdf_warnings ()
552552 assert wt == 'format error: cannot find object in xref (56 0 R)\n format error: cannot find object in xref (68 0 R)'
553+
554+
555+ def test_4445 ():
556+ print ()
557+ # Test case is large so we download it instead of having it in PyMuPDF
558+ # git. We put it in `cache/` directory do it is not removed by `git clean`
559+ # (unless `-d` is specified).
560+ import util
561+ path = util .download (
562+ 'https://github.com/user-attachments/files/19738242/ss.pdf' ,
563+ 'test_4445.pdf' ,
564+ size = 2671185 ,
565+ )
566+ with pymupdf .open (path ) as document :
567+ page = document [0 ]
568+ pixmap = page .get_pixmap ()
569+ print (f'{ pixmap .width = } ' )
570+ print (f'{ pixmap .height = } ' )
571+ if pymupdf .mupdf_version_tuple >= (1 , 26 ):
572+ assert (pixmap .width , pixmap .height ) == (792 , 612 )
573+ else :
574+ assert (pixmap .width , pixmap .height ) == (612 , 792 )
575+ if 0 :
576+ path_pixmap = f'{ path } .png'
577+ pixmap .save (path_pixmap )
578+ print (f'Have created { path_pixmap = } ' )
579+ wt = pymupdf .TOOLS .mupdf_warnings ()
580+ print (f'{ wt = } ' )
581+ assert wt == 'broken xref subsection, proceeding anyway.\n Trailer Size is off-by-one. Ignoring.'
You can’t perform that action at this time.
0 commit comments