unity.webp icon indicating copy to clipboard operation
unity.webp copied to clipboard

Animated WebP image issue using LoadTexturesAsync

Open dw8869 opened this issue 1 year ago • 6 comments
trafficstars

using unity.webp 0.3.11

Due to our application scenario, asynchronous loading is required. There is an issue of image output when you call the method below and use it.

WebP.Experiment.Animation.WebP.LoadTexturesAsync(byte[])

We tested 3 images.

  • https://colinbendell.github.io/webperf/animated-gif-decode/2.webp
  • https://colinbendell.github.io/webperf/animated-gif-decode/3.webp
  • https://mathiasbynens.be/demo/animated-webp-supported.webp

There is a problem with the pixel looking broken as shown in the screenshot below. image

And the error log below is also output. [WebPDecoderWrapper] Bytes to texture error: LoadRawTextureData: not enough data provided (will result in overread).

dw8869 avatar Feb 23 '24 02:02 dw8869

I also have same problem of that. There is something what I can't understand when passing decoding option. So please avoid to use Experiment that function.

  • check Samples/example2/animation.unity then moidfy WebpAnimation.cs logic to fit your game.

netpyoung avatar Mar 11 '24 06:03 netpyoung

@netpyoung As I checked, the WebPDemuxGetFrame function returns the width and height values abnormally.

dw8869 avatar Mar 11 '24 06:03 dw8869

@dw8869

It seems so. WebP.Experiment.Animation.WebPDecoderWrapper.CreateDecoder couldn't create proper decoder. I also tried to modify to change decoder's behaviour via options but failed until now.

netpyoung avatar Mar 11 '24 06:03 netpyoung