Skip to content

Commit

Permalink
Forces Coil to request the OriginalSize so that Images can be rendere…
Browse files Browse the repository at this point in the history
…d in bigger sizes than just the line height.
  • Loading branch information
vitorpamplona committed Jun 10, 2023
1 parent 3c5b38f commit 489ebd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ private val sampleMarkdown = """
##### Header 5
###### Header 6
---
## Full-bleed Image
![](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1920px-Image_created_with_a_mobile_phone.png)
## Emphasis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.compose.ui.unit.dp
import coil.annotation.ExperimentalCoilApi
import coil.compose.rememberAsyncImagePainter
import coil.request.ImageRequest
import coil.size.Size

private val DEFAULT_IMAGE_SIZE = 64.dp

Expand All @@ -33,6 +34,7 @@ internal actual fun RemoteImage(
val painter = rememberAsyncImagePainter(
ImageRequest.Builder(LocalContext.current)
.data(data = url)
.size(Size.ORIGINAL)
.crossfade(true)
.build()
)
Expand Down

0 comments on commit 489ebd0

Please sign in to comment.