Small non-critical bug in the Sandbox related to image assets uploading

Babylon.js Sandbox has the functionality to display uploaded image assets as textures.
Currently it supports ktx, ktx2, png, jpg and jpeg formats.
Meanwhile Babylon.js already supports WEBP image format as well.
Test Sandbox here -

I believe this line Babylon.js/packages/tools/sandbox/src/components/renderingZone.tsx at a99db8f4c490f6394037cf40e8c516be58ed8a26 · BabylonJS/Babylon.js · GitHub
should be changed to

return name.endsWith(".ktx") || name.endsWith(".ktx2") || name.endsWith(".png") || name.endsWith(".jpg") || name.endsWith(".jpeg") || name.endsWith(".webp");

to provide the support for uploaded .webp assets.

Later, I hope, it would be possible to add AVIF support as well (see this thread - GLB with WEBP Textures Converter - #4 by sebavan)

1 Like

You’re right, here’s the PR: