Skip to content
Prev Previous commit
Next Next commit
Update lib/matplotlib/backends/backend_agg.py
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
  • Loading branch information
AndrGutierrez and timhoffm authored Jul 29, 2025
commit f3408a3d6d0189937a368a5a1f847281db3769c8
5 changes: 5 additions & 0 deletions lib/matplotlib/backends/backend_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ def print_webp(self, filename_or_obj, *, metadata=None, pil_kwargs=None):
self._print_pil(filename_or_obj, "webp", pil_kwargs, metadata)

def print_avif(self, filename_or_obj, *, metadata=None, pil_kwargs=None):
if not PIL.features.check("avif"):
raise RuntimeError(
"The installed pillow version does not support avif. Full "
"avif support has been added in pillow 11.3."
)
self._print_pil(filename_or_obj, "avif", pil_kwargs, metadata)
Comment thread
AndrGutierrez marked this conversation as resolved.

(print_gif.__doc__,
Expand Down