Skip to content
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

Fix base64 image asset not fit container's size #2501

Merged
merged 1 commit into from May 14, 2024

Conversation

hblab-nghianh
Copy link
Contributor

Currently, I am encountering a similar issue to #1200, but in the case where the asset is a base64 image, it has not been fixed yet.

@@ -107,6 +107,7 @@ public void setDelegate(@Nullable ImageAssetDelegate assetDelegate) {
return null;
}
bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, opts);
bitmap = Utils.resizeBitmapIfNeeded(bitmap, asset.getWidth(), asset.getHeight());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you store the bitmap on the line above to a local variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gpeal I updated, please check

Copy link

Snapshot Tests
API 23: Report Diff
API 31: Report Diff

Copy link

Snapshot Tests
API 23: Report Diff
API 31: Report Diff

@gpeal gpeal merged commit 13bed12 into airbnb:master May 14, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants