Correctly handle high dpi in Pillow animation writer.#15691
Merged
Conversation
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.
57f02ad to
125394d
Compare
dopplershift
approved these changes
Nov 13, 2019
dopplershift
left a comment
Contributor
There was a problem hiding this comment.
This looks good to me.
timhoffm
approved these changes
Nov 14, 2019
Member
|
Not sure about the milestone. |
Contributor
|
I'm gonna put it on 3.2 because I think it's low risk and the incorrect behavior was pretty bad. |
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
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 to suggest an improvement. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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