New versions Lime/OpenFL doesn't support webp?

In Lime version 3.5.2 and OpenFL version 4.5.2 I used webp images, but in Lime version 4.0.2 and OpenFL version 4.9.1 I get error in this code:

lime_graphics_Image.loadFromBytes = function(bytes) {
	if(bytes == null) {
		return lime_app_Future.withValue(null);
	var type = "";
	if(lime_graphics_Image.__isPNG(bytes)) {
		type = "image/png";
	} else if(lime_graphics_Image.__isJPG(bytes)) {
		type = "image/jpeg";
	} else if(lime_graphics_Image.__isGIF(bytes)) {
		type = "image/gif";
	} else {
		throw new js__$Boot_HaxeError("Image tried to read PNG/JPG Bytes, but found an invalid header.");
	return lime_graphics_Image.loadFromBase64(lime_graphics_Image.__base64Encode(bytes),type);

It does not support webp?

Does it work differently if you force the asset type to image?

You could try openfl create DisplayingABitmap, add type="image" to the <assets /> tag, and use a webp image. If it works, then we’ll be able to fix the issue by adding webp as a known extension in the tools

Yes, embedded webp-image works, but when I try load webp-image via loader, I has an error about which I wrote above.

It should be fixed in the latest Lime dev, just be careful that it only works on Chrome:

1 Like

And on Opera. Thanks for reply!

:heart: Opera :grinning: