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

About support .svg or other format picture (like .gif) #121

Open
equationl opened this issue Jul 21, 2023 · 2 comments
Open

About support .svg or other format picture (like .gif) #121

equationl opened this issue Jul 21, 2023 · 2 comments

Comments

@equationl
Copy link
Contributor

In my project, I need to show .svg picture.

I can easy to edit like this to support:

Edit .\richtext-commonmark\src\androidMain\kotlin\com\halilibo\richtext\markdown\RemoteImage.kt :

val painter = rememberAsyncImagePainter(
  model = ImageRequest.Builder(LocalContext.current)
    .data(data = url)
    .size(Size.ORIGINAL)
    .crossfade(true)
    .build(),
  imageLoader = ImageLoader.Builder(LocalContext.current)
    .components {
      add(SvgDecoder.Factory())
    }
    .build()
)

I can using same way to show .gif, But it just for me.

Is there a way to make this library support optional? Cause not everyone need this.

@alexispurslane
Copy link

I really, really need SVG support for a project I'm working on, so I'd like this to be an option in the library as well. Especially since I can't figure out how to get gradle to build richtext as a subproject of my app

@zayass
Copy link

zayass commented Jun 24, 2024

You can customize ImageLoader through internal coil mechanism without any changes in library

The singleton ImageLoader can be configured by implementing ImageLoaderFactory on your Application class.

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

No branches or pull requests

3 participants