Crash when accessing image data


I am trying to access image data in Bytes for an image stored at Bundled/. The game compiles and starts. However, it immediately crashes giving no errors in the debug console if run with Krom. The HTML version does not crash, but the data read is a null value.

I am providing the TestFile.blend (588.0 KB) file,
Haxe script: MyTrait.hx (411 Bytes)

and the image used :

Could someone please point out where I am going wrong.

Thank you in advance.

Unless I’m missing something it seems that you have found a bug in Kromx.

The call in getPixels() starts here in Kha:
to a function called getTexturePixels / krom_get_texture_pixels in Krom/Kromx:
And with a bit of testing I pinpointed the crash to this line:
It seems that trying to access the Value() produces a crash.

I recommend opening an issue in the Kromx github repo. Also you can try compiling and using a binary build of Krom for the moment from here to see if it works the feature you need.

Also in HTML5 it returns null because it’s not yet implemented:

Update: I opened an issue in the Kromx repo