Commit 7aad47a
committed
Reuse png metadata handling of imsave() in FigureCanvasAgg.print_png().
This avoids duplicating the conversion of metadata to PngInfo and
revealed a bug in the priority between `metadata` and `pil_kwargs` in
imsave().
Note that because `np.asarray(self.buffer_rgba())` is already a RGBA
uint8 array, there is no colormapping step happening in imsave().
Ideally mplcairo should also be able to use imsave() for saving to png.1 parent 898bd5f commit 7aad47a
2 files changed
Lines changed: 8 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
502 | 501 | | |
503 | 502 | | |
504 | 503 | | |
505 | | - | |
506 | | - | |
507 | 504 | | |
508 | 505 | | |
509 | 506 | | |
510 | 507 | | |
511 | 508 | | |
512 | 509 | | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
523 | 514 | | |
524 | 515 | | |
525 | 516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1520 | 1520 | | |
1521 | 1521 | | |
1522 | 1522 | | |
1523 | | - | |
1524 | | - | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
1525 | 1527 | | |
1526 | 1528 | | |
1527 | 1529 | | |
| |||
0 commit comments