WebP animations support for iOS & Android
See original GitHub issueHi there,
I’m getting the exception below when I try to Load a Gif with the url: https://media3.giphy.com/media/3ohzdKbEOsJtrg2iCQ/200.webp That is a gif from the Giphy directory. if I use the *.gif extension it does work, but I am trying to use webp cause the 2x smaller. Do I have to do any specific setup?
I tried the sample app, and it also gives me the same exception.
[0:] Image loading failed: https://media3.giphy.com/media/3ohzdKbEOsJtrg2iCQ/200.webp
System.BadImageFormatException: Not a valid bitmap
at FFImageLoading.PlatformImageLoaderTask1[TImageView].GenerateImageFromDecoderContainerAsync (FFImageLoading.IDecodedImage
1[TNativeImageContainer] decoded, FFImageLoading.Work.ImageInformation imageInformation, System.Boolean isPlaceholder) [0x000a8] in C:\projects\ffimageloading\source\FFImageLoading.Droid\Work\PlatformImageLoadingTask.cs:215
at FFImageLoading.Work.ImageLoaderTask3+<GenerateImageAsync>d__104[TDecoderContainer,TImageContainer,TImageView].MoveNext () [0x002c4] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:307 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <43dbbdc147f2482093d8409abb04c233>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <43dbbdc147f2482093d8409abb04c233>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <43dbbdc147f2482093d8409abb04c233>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0
at FFImageLoading.Work.ImageLoaderTask`3+<RunAsync>d__109[TDecoderContainer,TImageContainer,TImageView].MoveNext () [0x004ae] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:588
Basic Information
- Version with issue: 2.4.3.840
- Last known good version:
- Platform: Android 5.1
Screenshots
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Thanks for your replay. You built a quite complex library.
I am using the gif animation on a chat feature on our APP. for now I am using the *.gif and sticking with smaller formats. But that would be big Plus.
Have a nice day!
First we need to add a new type
WebPAnimated
, here:https://github.com/luberda-molinet/FFImageLoading/blob/master/source/FFImageLoading.Common/Helpers/FileHeader.cs
Then, on Android it would be easy as adding
GifDecoder
forWebPAnimated
type: https://github.com/luberda-molinet/FFImageLoading/blob/87c69858b4546d8734968ae40fac4e616d256514/source/FFImageLoading.Droid/Work/PlatformImageLoadingTask.cs#L116On iOS we’ll need to add a new decoder, which merges two decoders: