Skip to content

Pillow 7.0.0 Support #16083

@marty-sullivan

Description

@marty-sullivan

Bug report

Pillow 7.0.0 is unsupported by pyplot.savefig when saving as jpeg.

Code for reproduction

With Pillow 7.0.0 installed:

import matplotlib.pyplot as plt

plt.plot(range(10))
plt.savefig('testplot.jpg')

The outcome is an exception is thrown, as follows:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 722, in savefig
    res = fig.savefig(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/matplotlib/figure.py", line 2180, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 2021, in print_figure
    canvas = self._get_output_canvas(format)
  File "/usr/local/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 1961, in _get_output_canvas
    raise ValueError(
ValueError: Format 'jpg' is not supported (supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz)

The expected outcome is that savefig saves a jpeg image without an exception. This works fine with Pillow 6.2.2 and lower.

Matplotlib version

  • Operating system: Linux
  • Matplotlib version: 3.1.2
  • Python version: 3.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy