Make upscaling images opt-in#59856
Merged
dnfield merged 6 commits intoflutter:masterfrom Jun 23, 2020
Merged
Conversation
goderbauer
approved these changes
Jun 19, 2020
| Future<ui.Codec> instantiateImageCodec(Uint8List bytes, { | ||
| int cacheWidth, | ||
| int cacheHeight, | ||
| bool allowUpscaling = false, |
Member
There was a problem hiding this comment.
Can you add a sentence about this parameter to the doc comment above?
Contributor
Author
There was a problem hiding this comment.
I updated the docstring in general here - there were some old no-longer-existant things in there and some formatting issues, as well as something that's changed about aspect ratio preservation. PTAL
Member
|
Cirrus failure are presumably resolved when the engine roll lands? |
Contributor
Author
|
Analysis issues are places in the code where I failed to fix up signatures. Will take a look and add the doc comment. |
Contributor
Author
|
My FROB run had lots of failures, but none of them seem related to this change. That's the best I can make of that :\ |
goderbauer
approved these changes
Jun 23, 2020
Member
goderbauer
left a comment
There was a problem hiding this comment.
Still LGTM
Thanks for the updated docs!
mingwandroid
pushed a commit
to mingwandroid/flutter
that referenced
this pull request
Sep 6, 2020
* Make upscaling images opt-in
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
We should be discouraging users from upscaling images, which causes increased memory usage. This problem arises because users typically do not know the intrinsic dimensions of the compressed image data, and may be providing cache width/height values that exceed the dimensions of the image.
Once this lands, we can default the parameter to false in the engine as well.
/cc @zanderso @chinmaygarde FYI
Related Issues
Part of #59578
Engine side PR was flutter/engine#19067
Tests
Test that upscaling still works when the parameter is set to true
Test that downscaling works (previously untested)
Test that upscaling is not applied when the parameter is set to false.
Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.
I'll do a FROB run to make sure this breaks nothing internally.