UnityWebRequestTexture GIF

Hi,
I have a question about downloading GIF images using UnityWebRequestTexture. I basically need to download a user icon whose format is beyond my control – can be either JPG, PNG or GIF.
As far as I understand, UnityWebRequestTexture can only be used to download Unity JPG and PNG images.

I already have the code for downloading those two formats (pretty much the same exact thing as in the documentation), which works fine; but any attempt to download a GIF results in this default texture:

3559411--286694--Unity default.png

Can a GIF be somehow downloaded with Unity?
One idea I got while writing this post is to use UnityWebRequest.Get to download the raw gif bytes and somehow parse them and convert them into a Texture – can it be done? Or is there a simpler solution?

1 Like

You probably want something like this: GitHub - westhillapps/UniGif: GIF image decoder for Unity. - you can supply it with the ‘www.bytes’ from a standard web request of the GIF URL.

3 Likes

thank u

Please use the like button, it’s exactly what it’s for. That way you don’t necro the thread and it doesn’t show as unread for everyone else.

Thanks.

1 Like