Ffimageloading: Gif low framerate on Android

Created on 13 Sep 2017  路  8Comments  路  Source: luberda-molinet/FFImageLoading

HI:

I am using
"xmlns:ffimageloading="clr-amespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"" for read a gif image. (WIth Xamarin.Forms)

<ffimageloading:CachedImage HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" DownsampleToViewSize="true" Aspect="AspectFit" HeightRequest="80" WidthRequest="80" Source="logo.gif"/>

The problem is that the animation of the gif is very very slow.

Is there some parameter that I am omitting?

Android help wanted up-for-grabs

All 8 comments

The problem is resolved.

I updated to "2.2.12-pre497" and it is correct the animation.

Thanks

I'll close this one then. Thanks.

I try using gif in 2.2.20 and the animation on Android is a little slower. On iOS works very well!
This is the gif:
loader_garzon

EDIT:
I try using other 3 gif and obtain same result, the animation is a little slower on Android.

https://media.giphy.com/media/cZDRRGVuNMLOo/giphy.gif

I think the issue is not resolved. @daniel-luberda

You should use 2.2.24 - there was a fix regarding Android gif delay, here: https://github.com/luberda-molinet/FFImageLoading/commit/2b18fd283d82d60f58094df8a5e45c6560bd310b

I'm using 2.2.24.

I'm using 2.2.25 in Xamarin Forms PCL project, and in android it's too slow

BackgroundColor="White" Aspect="AspectFit" DownsampleHeight="80">



EDIT:

i was watching (in my case) that only in browsers the gif show faster, the another applications like Photos in windows it show slower than browsers... so i just changed the gif animation and it works for me...
thanks a lot for your work @daniel-luberda

It's because of this: https://github.com/luberda-molinet/FFImageLoading/blob/master/source/FFImageLoading.Common/Helpers/Delay.cs

```C#
public static Task DelayAsync(int miliseconds)
{
if (miliseconds >= 60)
return Task.Delay(miliseconds);

return Task.Factory.StartNew(() => 
{
    using (var mres = new System.Threading.ManualResetEventSlim(false))
    {
        mres.Wait(miliseconds);
    }
}, TaskCreationOptions.PreferFairness);

}
```

The thing is Task.Delay accuracy is no more than 15ms. Does anyone know how could we improve that?

It's used here: https://github.com/luberda-molinet/FFImageLoading/blob/f3a706a2121597adf5acbfdfe8ead8b288104223/source/FFImageLoading.Droid/Views/ManagedImageView.cs#L103

Was this page helpful?
0 / 5 - 0 ratings