-
Notifications
You must be signed in to change notification settings - Fork 800
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
Jetpack: lossless image optimization of PNGs in projects/plugins/jetpack #38398
Jetpack: lossless image optimization of PNGs in projects/plugins/jetpack #38398
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
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 ran ImageMagick's compare
utility on all the images, and it didn't show any having any visual differences.
To reduce the risk of hitting the 20MB limit, we may want to do the following to merge and deploy this:
- Deploy everything pending to wpcom (see PCYsg-Jjm-p2). Or wait for the daily to happen.
- Merge this. Wait for CI to build and mirror to Automattic/jetpack-production.
- Deploy again right away.
- Also, probably would be good to run
tools/deploy-assets-to-svn.sh
after merging this to get the.w.org-assets
file changes onto wporg, so it doesn't surprise whoever does that next time for something unrelated.
Actually, now that I think about it more, that complex process wouldn't limit it to just this PR, because the deploy is from "previous sun to new sun" rather than "moon to sun". |
I looked into the previous diff that had to be split up and I'm wondering if the size of binary diffs is computed differently on github than at wpcom push. For Automattic/themes#7671, GitHub a 17 MB diff, but for some reason D144170-code ended up being 97 MB. On doing If I do the same thing for this diff, I get 16 MB for this diff, which is under the 20 MB limit, so if the issue was counting the entire file size and not the diff as the changed size, then this diff seems like it should still be safe as long as it's not bundled with too much other stuff. 4 MB would be quite a large diff for code changes, but if anyone happens to push asset changes at the same time, we could easily end up at over 20 MB. I could split this diff up more (this is about 1/3 of the total changes, so if we divide it in half, we'd end up with 6 PRs instead of 3). |
You're probably right that it counts the full size of the new files. OTOH, as far as this PR goes, note that none of the stuff in We may as well try it and see what happens. |
d128179
to
e104dfb
Compare
First of the two deploys (to sun) didn't hit the limit. We'll see what happens when it goes to moon tomorrow along with whatever other commits are merged by then. |
Great! And thanks for being so on top of this! I'll wait to see what happens before doing the next part of this. I can always break it up into arbitrarily tiny pieces if it turns out there was still a size issue. |
Moon deploy didn't run into a size issue either. |
Lossless image optimization of Jetpack images. This is a continuation of #38398 and #38573. Please see #38398 for more context and details. This finishes this series of commits. All images except for projects/js-packages/connection/components/disconnect-dialog/images/disconnect-thanks.jpg have been optimized. See @anomiex's debugging of the problem in #38750 (review) for more info on why that image was skipped.
Lossless image optimization of Jetpack images. This is a continuation of #38398 and #38573. Please see #38398 for more context and details. This finishes this series of commits. All images except for projects/js-packages/connection/components/disconnect-dialog/images/disconnect-thanks.jpg have been optimized. See @anomiex's debugging of the problem in #38750 (review) for more info on why that image was skipped.
Proposed changes:
This is part of a project to optimize images in wpcom. Since this used lossless optimizations, this have a user-observable impact other than improved performance.
Although Automattic doesn't tend to A/B test a lot of performance improvements, this in progress A/B test seems to show that we get significant gains in conversion rate / engagement and probably also revenue from optimizations like Automattic/wp-calypso#88786.
For jetpack, it seems like we need to push the change here and then have it get automatically copied back into wpcom. This is being split into multiple PRs in an attempt to avoid running into the 20 MB max commit size limit in wpcom. Although Automattic/themes#7671 was "only" 17MB, when that was automatically copied to wpcom, it exceeded the 20 MB limit. This PR is only 4.1 MB, which will hopefully avoid running into the 20 MB limit.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Without attempting to do any kind of automatic image content comparison, the simplest way to test this is probably to just look at the image diffs in github and eyeball them to make sure there aren't any drastic changes. That won't catch any issues that come up due to PNG metadata stripping, but unlike JPEG exif info, it's quite rare for users to rely on that metadata.