-
-
Notifications
You must be signed in to change notification settings - Fork 461
Compress Screenshots on a background thread #4295
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
Conversation
Performance metrics 🚀
|
| try (final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { | ||
| // 0 meaning compress for small size, 100 meaning compress for max quality. | ||
| // Some formats, like PNG which is lossless, will ignore the quality setting. | ||
| bitmap.compress(Bitmap.CompressFormat.PNG, 0, byteArrayOutputStream); |
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.
It's worth mentioning that we never call bitmap.recycle() - and we also didn't do before. But I guess it makes sense to do so!
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.
yeah, since we also create a new bitmap for every new screenshot we should probably recycle 😅
romtsn
left a comment
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.
LGTM!
* Compress Screenshots on a background thread * Update Changelog * Recover APIs used by hybrid SDKs * Recycle bitmap after compression
📜 Description
Fixes #3647
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps