Skip to content

Images loaded with coil don't show when using transformations #272

@ubuntudroid

Description

@ubuntudroid
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions