()
| 416 | |
| 417 | |
| 418 | def test_3854(): |
| 419 | path = os.path.normpath(f'{__file__}/../../tests/resources/test_3854.pdf') |
| 420 | with pymupdf.open(path) as document: |
| 421 | page = document[0] |
| 422 | pixmap = page.get_pixmap() |
| 423 | pixmap.save(os.path.normpath(f'{__file__}/../../tests/test_3854_out.png')) |
| 424 | |
| 425 | # 2024-11-29: this is the incorrect expected output. |
| 426 | path_expected_png = os.path.normpath(f'{__file__}/../../tests/resources/test_3854_expected.png') |
| 427 | pixmap_expected = pymupdf.Pixmap(path_expected_png) |
| 428 | pixmap_diff = gentle_compare.pixmaps_diff(pixmap_expected, pixmap) |
| 429 | path_diff = os.path.normpath(f'{__file__}/../../tests/resources/test_3854_diff.png') |
| 430 | pixmap_diff.save(path_diff) |
| 431 | rms = gentle_compare.pixmaps_rms(pixmap, pixmap_expected) |
| 432 | print(f'{rms=}.') |
| 433 | if os.environ.get('PYMUPDF_SYSINSTALL_TEST') == '1': |
| 434 | # MuPDF using external third-party libs gives slightly different |
| 435 | # behaviour. |
| 436 | assert rms < 2 |
| 437 | else: |
| 438 | assert rms == 0 |
| 439 | |
| 440 | |
| 441 | def test_4155(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…