Hi :slightly_smiling_face: I get `UnsupportedOpera...
# korge
b
Hi 🙂 I get
UnsupportedOperationException: No suitable image format : MAGIC:ノPNG(89504e47) (ノPNG)
when running this code in nodeJs. It works on JVM and js/browser:
Copy code
suspend fun createThumbnail(file: ByteArray, maxWidth: Int, maxHeight: Int): Thumbnail {
    val image = file.asMemoryVfsFile().readNativeImage() <-- I think the exception throws here.
    val resizedImage = image.resizedUpTo(maxWidth, maxHeight)
    return Thumbnail(resizedImage.encode(PNG), ContentType.Image.PNG, resizedImage.width, resizedImage.height)
}
Any idea? Maybe I'm using the API wrong.