community icon indicating copy to clipboard operation
community copied to clipboard

Add variable frame delay for GIF animated images

Open crimsonbay opened this issue 5 years ago • 9 comments

crimsonbay avatar May 16 '20 21:05 crimsonbay

Thanks for opening your first pull request here! 💖 Please check out our contributing guidelines.

welcome[bot] avatar May 16 '20 21:05 welcome[bot]

Ok, makes sense. Long term though, wouldn't you say that by default we should be using animation delays provided by the gif loader? Isn't that something you'd almost always want?

If so, maybe we should break backward compat (this is 2.0.0 after all) and have it default to True? Alternatively, we should make it clear in the docs that maybe in a couple of releases we'll change it to default to True?

matham avatar May 23 '20 23:05 matham

Ok, makes sense. Long term though, wouldn't you say that by default we should be using animation delays provided by the gif loader? Isn't that something you'd almost always want?

If so, maybe we should break backward compat (this is 2.0.0 after all) and have it default to True? Alternatively, we should make it clear in the docs that maybe in a couple of releases we'll change it to default to True?

@matham @tshirtman I agree, but I don’t know how things like this are being solved, maybe you will somehow agree among themselves, core developers? Default sets here kivy/uix/image.py:202 auto_anim_delay = BooleanProperty(False)

p.s. I don't like this float comparison kivy/core/image/init.py:711 if all(elem == x[0] for elem in x) Maybe I should replace this with this? if all("%.3f" % elem == "%.3f" % x[0] for elem in x)

crimsonbay avatar May 24 '20 07:05 crimsonbay

@matham could you see my updated code

crimsonbay avatar May 26 '20 15:05 crimsonbay

@matham Could you please review my code again?

  1. I deleted this check because taking these durations from GIF file and then everything goes as if you explicitly set the durations.
  2. Now if we specify the duration explicitly, we consider the automatic setting to be false

There is little merge conflict. Should I resolve it in my branch locally and push or is it better not to touch?

crimsonbay avatar Jun 02 '20 09:06 crimsonbay

@matham Could you please see my code again? I changed the use of parameters and described them in code doc-strings. Fix code for using with AsyncImage and zipsequence. Thank you for your patience with parsing my fixes.

crimsonbay avatar Jun 15 '20 15:06 crimsonbay

@matham Сould you take a look at my code again?

crimsonbay avatar Jul 20 '20 18:07 crimsonbay

@pythonic64 Thanks, I fixed.

crimsonbay avatar Jul 21 '20 19:07 crimsonbay

I'd feel much more comfortable if there were tests testing these new options/properties. Because I'm not sure it's working correctly. I see I have some requested changes that I started working on back then but didn't complete, so I'll post it now, but since I didn't spend time on it since, you can just think of it as potential concerns rather than for sure issues.

There were a lot more concerns I had, but came to conclusion it's better if I just try to resolve it myself because it's hard to do it through review, but unfortunately had no time since.

matham avatar Mar 22 '21 21:03 matham