Exception when trying to readBitmap() JPEG
val l = localVfs(fullName).readAll()
val file = l.openAsync().asVfsFile()
Log.WriteLog("AAA", "Im here 1")
val image = file.readBitmap()
Log.WriteLog("AAA", "Im here 2")
val image32 = image.toBMP32()
Log.WriteLog("AAA", "Im here 3")
Im here 1
Exception java.lang.UnsupportedOperationException: No suitable image format : MAGIC: Ï ß(ffd8ffe1) ( Ï ß)
at korlibs.image.format.ImageFormats.readImageContainer(ImageFormats.kt:148)
at korlibs.image.format.ImageFormat.readImage(ImageFormat.kt:39)
at korlibs.image.format.ImageFormat.read(ImageFormat.kt:68)
at korlibs.image.format.ImageFormat.decode(ImageFormat.kt:83)
at korlibs.image.format.KorioExtKt._readBitmap(KorioExt.kt:112)
at korlibs.image.format.KorioExtKt._readBitmap$default(KorioExt.kt:94)
at korlibs.image.format.KorioExtKt.readBitmap(KorioExt.kt:24)
What exactly are you trying to do? Just load an image to Display? Also please share your whole code
var whiteRook = resourcesVfs["w_rook.png"].readBitmap()
If you Just want to load a simple Image just do that
I want to read the image as Bitmap32 so I can do some cropping manipulations on it like this Bitmap32.mipmap()
Well I guess you are just reading the bitmap wrong, try swapping out localVFS for resourcesVfs as in the docs. https://docs.korge.org/resources/ ->reading Bitmaps https://docs.korge.org/imaging/bitmap/ -> Cropping help
I'm trying to optimize image from an arbitrary file or from a byte array, in JPEG-format. Not a resource file. This worked fine before