Skip to content

Factor common parts of saving to different formats using pillow. #21376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Oct 18, 2021

We don't need to drop the alpha channel for jpeg anymore as imsave
handles that.

In imsave, also clarify that sm is not going to be used in the
already-usable-rgba case.

Also, spliting out pil_kwargs under "other parameters" seems overkill
for an effectively internal method (savefig is the user-facing API).

Followup to #21274.

PR Summary

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@anntzer anntzer added this to the v3.6.0 milestone Oct 18, 2021
We don't need to drop the alpha channel for jpeg anymore as imsave
handles that.

In imsave, also clarify that `sm` is not going to be used in the
already-usable-rgba case.

Also, spliting out pil_kwargs under "other parameters" seems overkill
for an effectively internal method (`savefig` is the user-facing API).
mpl.image.imsave(
filename_or_obj, self.buffer_rgba(), format=fmt, origin="upper",
dpi=self.figure.dpi, metadata=metadata, pil_kwargs=pil_kwargs)

@_check_savefig_extra_args
@_api.delete_parameter("3.5", "args")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't follow if since is supposed to be the last version that has the parameter or first version without it
https://matplotlib.org/stable/_modules/matplotlib/_api/deprecation.html#delete_parameter

Copy link
Contributor Author

@anntzer anntzer Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, since is the version where the deprecation was introduced (as for _api.deprecated); args is getting deprecated in 3.5.

@story645 story645 merged commit 9fb5370 into matplotlib:master Oct 20, 2021
@anntzer anntzer deleted the aggfmts branch October 20, 2021 06:36
tacaswell pushed a commit that referenced this pull request Oct 20, 2021
Factor common parts of saving to different formats using pillow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants