https://kotlinlang.org logo
#compose-web
Title
# compose-web
g

Garret Yoder

10/11/2023, 4:07 PM
Is there a proper way to display images on web? It seems to be failing to display android style xml vector images where it works on jvm in the same project normal PNG's loaded through painterResource also take a noticeable amount of time to load. Is this just a side effect of the JS backend or should I be doing something different?
o

Oleksandr Karpovich [JB]

10/12/2023, 10:42 AM
jfyi: https://github.com/JetBrains/compose-multiplatform/issues/3468 - yes, it can be slow.
It seems to be failing to display android style xml vector images where it works on jvm in the same project
What Compose version do you use? It's expected to work in 1.5.3, unless there is a bug
g

Garret Yoder

10/12/2023, 5:30 PM
1.5.3 seems to have fixed it, I guess I missed that release, thanks! Noted on the bug, vectors seem to be fine and unaffected so I'll try to stick to those where I can. The only other thing I notice is on both JVM and JS, SVGs (these came straight from Google's material icons page) will crash on
Failed to Image::makeFromEncoded
, and the stacktrace is a bit cryptic so I can't nail down where it's coming from. A XML vector of the same icon/image will load fine.
8 Views