Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Correctly handle high dpi in Pillow animation writer.#15691

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

anntzer
Copy link
Contributor

@anntzeranntzer commentedNov 13, 2019
edited
Loading

The idea is just to pass self.dpi to savefig() and then use
self.frame_size as the frame size rather than looking up renderer
internals, but this is made easier by properly moving some attributes
and methods (some of__init__,setup,frame_size) from MovieWriter
(which should really be called SubprocessMovieWriter, as that's what
it does) to AbstractMovieWriter, so that PillowWriter can reuse
them without having to carefully prevent any attempt of starting a
subprocess.

Closes#15678, attn@dopplershift.

I... don't understand the doc build failure, likely something with autosummary and inheritance?
Edit: looks like that's indeed the problem, there's already a missing-references entry for PillowWriter.frame_size so I don't feel too bad adding one for MovieWriter.frame_size (now that it's defined in AbstractMovieWriter.frame_size).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

The idea is just to pass self.dpi to savefig() and then useself.frame_size as the frame size rather than looking up rendererinternals, but this is made easier by properly moving some attributesand methods (some of `__init__`, `setup`, `frame_size`) from MovieWriter(which should really be called SubprocessMovieWriter, as that's whatit does) to AbstractMovieWriter, so that PillowWriter can reusethem without having to carefully prevent any attempt of starting asubprocess.
Copy link
Contributor

@dopplershiftdopplershift left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@timhoffm
Copy link
Member

Not sure about the milestone.

@dopplershiftdopplershift added this to thev3.2.0 milestoneNov 14, 2019
@dopplershift
Copy link
Contributor

I'm gonna put it on 3.2 because I think it's low risk and the incorrect behavior was pretty bad.

@dopplershiftdopplershift merged commit6b1d416 intomatplotlib:masterNov 14, 2019
@lumberbot-app
Copy link

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.2.x$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 6b1d416d03488ead9e8b887e9e5fc9c1145a228b
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #15691: Correctly handle high dpi in Pillow animation writer.'
  1. Push to a named branch :
git push YOURFORK v3.2.x:auto-backport-of-pr-15691-on-v3.2.x
  1. Create a PR against branch v3.2.x, I would have named this PR:

"Backport PR#15691 on branch v3.2.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free tosuggest an improvement.

@dopplershift
Copy link
Contributor

heh, or maybe not. I don't think this is so important as to need a manual backport, so I'm going to kick to 3.3.

@dopplershiftdopplershift modified the milestones:v3.2.0,v3.3.0Nov 14, 2019
@anntzeranntzer deleted the pillowhighdpianimation branchNovember 15, 2019 00:01
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dopplershiftdopplershiftdopplershift approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.3.0
Development

Successfully merging this pull request may close these issues.

Error at save animation with pillow
4 participants
@anntzer@timhoffm@dopplershift@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp