Commit 41b671b
committed
Fixed SVG-as-text image comparison tests.
SVG-as-text tests make make the figure background transparent, but its colour (i.e. under the transparent mask) is actually black. Before the expected and actual images are compared, they are converted from RGBA to RGB, which makes them both completely black (since the text is also black). As a result, the test passes even if the expected and actual images differ. Not ignoring the transparency layer fixes this problem: discard the transparency layer (if any) only if the image is completely opaque.1 parent 40dea5a commit 41b671b
File tree
2 files changed
+811
-753
lines changed- lib/matplotlib
- testing
- tests/baseline_images/test_bbox_tight
2 files changed
+811
-753
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
374 | 381 | | |
375 | 382 | | |
376 | 383 | | |
| |||
435 | 442 | | |
436 | 443 | | |
437 | 444 | | |
438 | | - | |
439 | | - | |
440 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
441 | 448 | | |
442 | 449 | | |
443 | 450 | | |
| |||
486 | 493 | | |
487 | 494 | | |
488 | 495 | | |
489 | | - | |
490 | | - | |
491 | | - | |
| 496 | + | |
| 497 | + | |
492 | 498 | | |
493 | 499 | | |
494 | 500 | | |
| |||
0 commit comments