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

Placeholder image messes up image ContentScale #2779

Open
Vaibhav2002 opened this issue Jan 7, 2025 · 1 comment
Open

Placeholder image messes up image ContentScale #2779

Vaibhav2002 opened this issue Jan 7, 2025 · 1 comment
Labels
help wanted Issues that are up for grabs + are good candidates for community PRs

Comments

@Vaibhav2002
Copy link

Describe the bug
If i use placeholder then the final image does not have the correct contentScale or height, it stays the same height which the placeholder has

To Reproduce
Run this code

With Placeholder

image
AsyncImage(
    model = "https://images.unsplash.com/photo-1595757816291-ab4c1cba0fc2?fm=jpg&q=60&w=3000&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8cmVkJTIwYmFja2dyb3VuZHxlbnwwfHwwfHx8MA%3D%3D",
    modifier = Modifier.fillMaxWidth().padding(16.dp),
    contentScale = ContentScale.FillWidth,
    placeholder = painterResource(Res.drawable.placeholder_large),
    contentDescription = "Image"
)

Expected

image

Achieved by removing the placeholder

AsyncImage(
    model = "https://images.unsplash.com/photo-1595757816291-ab4c1cba0fc2?fm=jpg&q=60&w=3000&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8cmVkJTIwYmFja2dyb3VuZHxlbnwwfHwwfHx8MA%3D%3D",
    modifier = Modifier.fillMaxWidth().padding(16.dp),
    contentScale = ContentScale.FillWidth,
    contentDescription = "Image"
)

Version
3.0.4

@colinrtwhite colinrtwhite added the help wanted Issues that are up for grabs + are good candidates for community PRs label Jan 15, 2025
@davidtrpchevski
Copy link

I can vouch for this. Also messes up the Alignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that are up for grabs + are good candidates for community PRs
Projects
None yet
Development

No branches or pull requests

3 participants