coil-kt / coil

Image loading for Android and Compose Multiplatform.
https://coil-kt.github.io/coil/
Apache License 2.0
10.83k stars 664 forks source link

Image quality decreased when updated coil from 2.7.0 to 3.0.1 #2663

Closed drishyadivan closed 1 week ago

drishyadivan commented 1 week ago

Describe the bug Image quality decreased when updated coil from 2.7.0 to 3.0.1

To Reproduce AsyncImage( model = ImageRequest.Builder(LocalContext.current) .data(imageLink.value) .crossfade(300) .memoryCachePolicy(policy = CachePolicy.ENABLED) .build(), contentDescription = workoutImageDescription, modifier = Modifier .fillMaxSize() .align(Alignment.TopCenter) .zIndex(2f), contentScale = ContentScale.Crop )

This code was running perfectly in 2.7.0, but behaving differently in 3.0.1. Image shown is blurred.

Version 3.0.1

colinrtwhite commented 1 week ago

There isn't enough info here to debug. What's the complete composable that triggers this?

IndusAryan commented 1 week ago

I have this issue in a shapeable image view with style radius 50% with circle crop transformation using center scale type, this issue is present in 3.0.1, I will check and confirm if it is present in 3.0.0

drishyadivan commented 1 week ago

The above code is working in 2.7.0. We updated coil version to latest one and changed imports accordingly to coil3. In 3.0.0-alpha09 - Not working 3.0.0-alpha10 - Not working 3.0.0-rc01 - Not working 3.0.0-rc02 - Not working 3.0.0 - Not working 3.0.1 - Not working 3.0.2 - Not working

 When coil version reverted back to 2.7.0 and changed imports to coil, it is working. No parent composable are changed.
 Only version updates are done.
colinrtwhite commented 1 week ago

@drishyadivan I tried running your code and it worked as expected (see below). Please create a new issue with a reproducible sample.

iZakirSheikh commented 1 week ago

Describe the bug Image quality decreased when updated coil from 2.7.0 to 3.0.1

To Reproduce AsyncImage( model = ImageRequest.Builder(LocalContext.current) .data(imageLink.value) .crossfade(300) .memoryCachePolicy(policy = CachePolicy.ENABLED) .build(), contentDescription = workoutImageDescription, modifier = Modifier .fillMaxSize() .align(Alignment.TopCenter) .zIndex(2f), contentScale = ContentScale.Crop )

This code was running perfectly in 2.7.0, but behaving differently in 3.0.1. Image shown is blurred.

Version 3.0.1

This might be happening because the image on which you click is being loaded by coil in the bigger view. Maybe there is a bug with inMemory of Coil3 whaich doesnt take into account the image dimens. I was having the same issue then I set new memoryCachekey in bigger image view and this got resolved. Now I observed, the image is loaded slowly.