Fix incorrect size of thumbnails in media picker#21204
Merged
Conversation
Contributor
Author
|
The order of the assets is not stable, btw. It'll be great to fix that too. |
Contributor
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21204-d221382 | |
| Version | 22.9 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | d221382 | |
| App Center Build | WPiOS - One-Offs #6544 |
Contributor
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21204-d221382 | |
| Version | 22.9 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | d221382 | |
| App Center Build | jetpack-installable-builds #5575 |
staskus
approved these changes
Jul 31, 2023
Contributor
staskus
left a comment
There was a problem hiding this comment.
Thanks for the fix, looks good! 👍
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.


Fixes #21197 (see for more info on the root cause)
To test:
Important
MediaThumbnailServicestores thumbnails on disk. You'll need to re-install the app or clear the caches in other ways to verify the size reduction.We can make one more improvement: the app downloads full GIFs but displays only the first frame. We can change the app to download only the first frame. It will dramatically reduce the download size even further. But I'm not sure how yet.
Measurements
This test scenario is a bit exaggerated because I have multiple GIFs in this library, but the size reduction apply equally to all images.
Notes
The method to fetch the thumbnails that I modified is used with non-zero size only from here:
This
imageWithSizeis in turn is called only from WPMediaCollectionViewCell and it passes the size in pixels:Regression Notes
PR submission checklist:
RELEASE-NOTES.txtif necessary.UI Changes testing checklist: