mikepenz/multiplatform-markdown-renderer

Images are rendered using only remote paths

Meister1593 opened this issue · 7 comments

About this issue

You can make images using remote links (https, http), but you can't specify local path to render local image
i've tried ./path/img.png, path/img.png, file:///path/img.png but none worked so far
and by the looks of imagePainter in ImagePainterProvider - it won't, because it fetches image always through http

Credited project could use local image paths

Details

  • [multiplatform-markdown-renderer 0.4.0]
  • [Desktop]
  • [Compose 1.1.1]
  • [Gradle 7.2]
  • [JDK 17]

Thank you very much for the report.

Not sure how quick I can have a look into this. Maybe you'd like to open a PR to expand the library with this feature.

I will try making PR, i kinda need this functionality asap (turns out, making multi-module project is harder than i thought, i initially wanted just to include project into mine and correct it)

In the end i switched to just using just Jetpack DSL alone, because of time constraints. Generally it works fine for my needs, even though it's quite verbose.
If i will make pr, it probably won't be soon too

Thank you for the update.

Closing due to inactivity

So local images are not available I suppose?

@EzzPress at the current time not. You can see the ImagePainter implementation here:

return rememberAsyncImagePainter(
model = ImageRequest.Builder(LocalContext.current)
.data(url)
.size(Size.ORIGINAL)
.build()
)
for example.

There is still the call for a PR around that feature.
The PR could also make the used ImagePainter configurable (which would probably be the more flexible approach)

Personally I am waiting for Coil's multiplatform support to update the library then