Skip to content

Commit

Permalink
Fix Thumbnails by upgrading kamel to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanLobbenmeier committed Dec 24, 2024
1 parent 30b0ba4 commit 90674de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
val kotestVersion = "5.9.1"
val kotlinProcessVersion = "1.5"
val kotlinxSerializationVersion = "1.7.3"
val kamelVersion = "0.4.1"
val kamelVersion = "1.0.2"

implementation(compose.desktop.currentOs)

Expand All @@ -49,7 +49,7 @@ dependencies {
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("com.github.pgreze:kotlin-process:$kotlinProcessVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion")
implementation("com.alialbaali.kamel:kamel-image:$kamelVersion")
implementation("media.kamel:kamel-image-default:$kamelVersion")
implementation("br.com.devsrsouza.compose.icons.jetbrains:feather:1.0.0")
implementation("io.github.oshai:kotlin-logging-jvm:7.0.3")
implementation("org.slf4j:slf4j-simple:2.0.16")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import io.kamel.image.KamelImage
import io.kamel.image.lazyPainterResource
import io.kamel.image.asyncPainterResource

@Composable
fun Thumbnail(thumbnail: String?) {
val modifier = Modifier.aspectRatio(16f / 9f)

if (thumbnail != null) {
val painterResource = lazyPainterResource(data = thumbnail)
KamelImage(
resource = painterResource,
resource = { asyncPainterResource(data = thumbnail) },
contentDescription = "Profile",
modifier = modifier,
onLoading = { progress -> ProgressIndicator(modifier, progress) }
Expand Down

0 comments on commit 90674de

Please sign in to comment.