google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.42k stars 597 forks source link

[Image loading] Coil/Glide doesn't show SVG images by url #440

Closed ArtyomZhukov closed 3 years ago

ArtyomZhukov commented 3 years ago

To Reproduce

           //Png images are displayed
            Image(
                modifier = Modifier
                    .padding(6.dp)
                    .size(32.dp),
                painter = rememberCoilPainter(request = "https://cdn.coinranking.com/eKKejWkdo/sushiswap.png"),
                contentScale = ContentScale.Fit,
                contentDescription = null
            )
            //Svg images are not displayed
            Image(
                modifier = Modifier
                    .padding(6.dp)
                    .size(32.dp),
                painter = rememberCoilPainter(request = "https://cdn.coinranking.com/HJzHboruM/atom.svg"),
                contentScale = ContentScale.Fit,
                contentDescription = null
            )
            Image(
                modifier = Modifier
                    .padding(6.dp)
                    .size(32.dp),
                painter = rememberCoilPainter(request = "https://cdn.coinranking.com/HhSqAIEpK/kusama[1].svg"),
                contentScale = ContentScale.Fit,
                contentDescription = null
            )

Environment:

chrisbanes commented 3 years ago

I suggest that you go to the Coil or Glide docs and lookup SVG support. This isn’t an Accompanist issue.

ArtyomZhukov commented 3 years ago

Solution: https://coil-kt.github.io/coil/svgs/