Markwon: Images loaded with coil don't show when using transformations

  • Markwon version: 4.4.0

When using the coil plugin and applying transformations as explained in the documentation images are not displayed (only the placeholder appears) when returning to a previously displayed TextView with markdown.

It doesn’t seem to matter which transformations you use and how many. Removing the transformations makes the issue go away.

Markwon configuration:

Markwon.builder(activity)
    .usePlugin(
        CoilImagesPlugin.create(
            object : CoilImagesPlugin.CoilStore {
                override fun load(drawable: AsyncDrawable): LoadRequest {
                    return LoadRequest.Builder(context)
                        .transformations(
                            RoundedCornersWithoutCropTransformation(14f)
                        )
                        .data(drawable.destination)
                        .placeholder(R.drawable.image_placeholder)
                        .build()
                }

                override fun cancel(disposable: RequestDisposable) {
                    disposable.dispose()
                }   
            },
            ImageLoader.Builder(activity)
                .okHttpClient(okHttpClient)
                .placeholder(R.drawable.image_placeholder)
                .build()
        )
    )
    .build()

Steps to reproduce:

  1. Open a fragment with a TextView that is populated using Markwon with some markdown containing images.
  2. Put the app to background.
  3. Reopen the app from recents.
  4. Observe: the images are not displayed anymore (only placeholders are shown). If an image didn’t load in step 2 (e.g. you advanced too quickly or the loading failed) it will load now (if not blocked by some external factors), but also just once.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

Fixed in 4.5.1

4.5.1-SNAPSHOT with the fix is available right now 😉 . Can you please check if it works for you? If it does a minor stable release can be done in the nearest future