Image.fromBytes() doesn't work as expected in HTML5


#1

To see this, go to the ‘SimpleImage’ lime sample and edit line 39 to look like:

image = Image.fromBytes(Assets.getBytes("assets/lime.png"));

Then do ‘lime test html5’ in the prompt to see what I mean. It works fine under Neko (Windows 10) and Android.


#2

Try using Image.loadFromBytes, it’s necessary to wait for loading an image from bytes in the browser


#3

Unfortunately, I have tried

Image.loadFromBytes(.....).result()

and

Image.loadFromBytes(.....).value

both without success.


#4

Try

Image.loadFromBytes (bytes).onComplete (function (image) {
    trace ("loaded image");
}).onError (function (e) {
    trace (e);
});

We cannot block on HTML5, either


#5

Ah, I see. Thank you very much.