-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Updates to image optimization settings #19581
Conversation
The strings have been updated to reflect the popup's change in functionality. It will now be informing users about the fact optimization is enabled by default, rather than the fact it used to be off by default.
The advertiseImageOptimization() function will now be called when a user uploads a photo from their device.
Following the last merge from `trunk`, the `STOCK_MEDIA_PICKER_SINGLE_SELECT` case was accidentally duplicated. This PR reverts that mistake.
This was accidentally removed when updating from `trunk` in a previous commit.
This commit fixes the bug pinpointed here, in which media wasn't uploading if the popup wasn't displayed: https://github.com/wordpress-mobile/WordPress-Android/pull/19556/files#r1386846666
As noted here, the default yields the same result, whether it's 0 or 1. So, a change is not necessary: https://github.com/wordpress-mobile/WordPress-Android/pull/19556/files#r1386712864
Following the review here, the logic surrounding the popup's button has been refactored to make it more clear and readable: #19556 (comment)
The wording has been changed following feedback from the editorial team here: wordpress-mobile/WordPress-iOS#21981 (comment)
…t-image-optimization-setting Enable image optimization setting by default
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
To match the default values for image quality for iOS (see: wordpress-mobile/WordPress-iOS#21981), this commit changes the defaults for quality to the following: - Low = 70% - Medium = 80%
Following the last commit, the numbers in the string names no longer reflect reality. As such, they're updated in this commit to reflect the level of quality they represent.
…fault-resolution Update default max size to 2000 for optimized images
…update-optimization-values
Addresses bug reported here: https://github.com/wordpress-mobile/WordPress-Android/pull/19644/files#r1402179477 As we've made changes to the values in the quality array, there may be times when users have previously chosen values that no longer exist. Those cases were not being properly handled in the code. With this commit, we now check if a quality value exists in the array. If it doesn't, we return the default quality value.
In cases when a quality value is invalid, we should explicitly detect that and then return the default quality value. Otherwise, the invalid value will continue to be returned. Response to the following feedback: #19644 (comment)
…zation-values Update values associated with "Low" and "Medium" image quality settings
"app_settings_optimize_images_popup_changed" has been renamed to "app_settings_optimize_images_popup_tapped" to clarify the action the user's taken. Tapping the popup may not necessarily change the optimization value. This also brings the event in alignment with the naming used on iOS. The list position of the tracks event has also been changed, so that it's grouped closer to other settings related to image optimization.
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<string name="media_encoder_quality_maximum">الحد الأقصى</string> | ||
<string name="media_encoder_quality_very_high">مرتفع للغاية</string> | ||
<string name="media_encoder_quality_high">مرتفع</string> | ||
<string name="media_encoder_quality_medium">متوسط</string> | ||
<string name="media_encoder_quality_low">منخفض</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we had to update all localizations. Based on the file history (example), seems these localization files are updated automatically as part of the release process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good to know for the future!
WordPress/src/main/java/org/wordpress/android/util/WPMediaUtils.java
Outdated
Show resolved
Hide resolved
@SiobhyB As a side note and regarding the test section Since we've changed the quality values, if the Low value was previously set, the quality displayed after upgrading the app will be Medium. Not sure if users might be confused with this change, I presume that not many users use the lowest quality, hence probably it would be a minor percentage. |
Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
Refactors two if statements into a single statement, as it was possible to group the two conditions. Addresses the following feedback: #19581 (comment)
Thanks @fluiddot! 🙌
I agree it may confuse a small percentage of people but, as they'll keep the 80% compression rate, hopefully most won't notice. 🤞 I'll go ahead to merge this PR once the tests pass. |
Generated by 🚫 Danger |
Description
This PR changes the default setting for
Optimize Images
(found via Me → App Settings) from off → on. We will also inform users of this new default via a popup that will display when uploading media.The default
Maximum Image Size
has also been updated from 3000px to 2000px and theImage Quality
's Medium value has been changed from 85% to 80%.You can find the iOS equivalent at wordpress-mobile/WordPress-iOS#21981.
Included PRs
The following three PRs were merged into this one, with all of them having been separately reviewed and approved:
To test
Verify default setting displays as expected⤵️
Default setting should be changed if it has never been set before
Default setting should not be changed if it has been set previously
Set original as maximum image size
Set maximum image size
Resize settings should function as expected⤵️
Compression settings should function as expected⤵️
Pop-up should be displayed in specific sources⤵️
Media Screen
My Site → Media
.Choose from My Device
option.Add
button.Gutenberg Editor
Preparation:
My Site → Posts
(or Pages).Media Blocks - From Device
Choose from device
option.Media Blocks - Take Photo
Take a Photo
option.Featured Image - From Device
...
button located on the top bar.Post Settings
options.Set Featured Image
.Choose from Device
option.Featured Image - Take Photo
...
button located on the top bar.Post Settings
options.Set Featured Image
.Take a Photo
option.Check events⤵️
Verify that the new
APP_SETTINGS_OPTIMIZE_IMAGES_POPUP_TAPPED
event is sent when tapping either of the options in the new popup.on
will be sent if you leave optimization on andoff
if it's turned off via the popup.Regression Notes
As we're changing default settings, there's a risk of unintentionally changing settings users have chosen. We're also changing code around the App Settings screen and media upload flows, so there could be unintended impact there.
Manually tested each flow we identified and relied on existing tests around media uploads.
I plan to further analyse existing tests and potentially add new ones in a future PR.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.