Loading Webp image as Texture2d

I am trying to download images from a storage and put them in planes.

Eventhough the images ending are .png, their bytes actually point to them being Webp.
I do not have control over the image webp type.

When I try to download and load a .png image with my code in unity, it works great.
When I tru to download and load a webp image with the same code, it gives me a Download Handler error:

Fallback request failed: Data Processing Error, see Download Handler error
UnityEngine.Debug:LogError (object)
ShelfPopulator/<LoadImageAndPopulateRobust>d__10:MoveNext () (at Assets/Scripts/ShelfPopulator.cs:157)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/Coroutines.cs:17)

However, when I take the same webp image and drag into unity (with .png ending on the name), it works as a Texture 2D for the exact same plane (I checked and the file does not become .png, it keeps being webp type).

I would rather not using an outside library to do this, and I am guessing there is some workaround this, as by dragging it unity does recognize webp.

Any ideas on how this could be done?
Thank you in advance.

I’m guessing this is due to whether the code runs in the editor vs at runtime (builds, but even in playmode it may behave differently).

Importing assets at runtime is a lot more limited than what the editor is able to import.

Do you have any suggestions on what I can do about it and if there is any workaround it?

Note: Only JPG and PNG formats are supported.

(From: Unity - Scripting API: Networking.UnityWebRequestTexture.GetTexture)

The easiest workaround is to use either PNG or JPG.

The alternative is to find a WebP decoder library that works in Unity (a fully managed .NET Standard one would be the easiest) and then figure out how get data out of it that you then can put into a Texture2D using Texture2D.SetPixelData or Texture2D.LoadRawTextureData.

I ended up using GitHub - netpyoung/unity.webp: 🎨 WebP made easy for Unity3d
It would be nice if unity would support it natively