All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.mikepenz.markdown.coil2.Coil2ImageTransformerImpl.kt Maven / Gradle / Ivy

Go to download

Kotlin Multiplatform Markdown Renderer. (Android, Desktop, ...) powered by Compose Multiplatform

There is a newer version: 0.27.0-b02
Show newest version
package com.mikepenz.markdown.coil2

import androidx.compose.runtime.Composable
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.painter.Painter
import com.mikepenz.markdown.model.ImageData
import com.mikepenz.markdown.model.ImageTransformer

object Coil2ImageTransformerImpl : ImageTransformer {

    @Composable
    override fun transform(link: String): ImageData? {
        return imagePainter(link)?.let { ImageData(it) }
    }

    @Composable
    override fun intrinsicSize(painter: Painter): Size {
        return painterIntrinsicSize(painter)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy