Interesting apparently not all gif formats are supported by the underlying libraries that provide gif support. It is possible to convert the gif file to a zip file of images and use that instead.
I used this site to convert the .gif to a zip of images. https://ezgif.com/split
I have attached the resulting file.
I tested with this code, it works and looks good. Note I needed to set the anim_delay to get 15fps.
from kivy.app import App
from kivy.lang import Builder
kv = """
BoxLayout:
orientation: 'vertical'
Image:
source: 'ezgif-2-3826eb7bb9-gif-im.zip'
anim_delay: .0667 # 15 fps
Label:
text: 'Smoking Skull'
size_hint_y: None
height: dp(48)
"""
class TestSmokingSkullGifApp(App):
def build(self):
return Builder.load_string(kv)
TestSmokingSkullGifApp().run()
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/415f4a0c-d802-4ab4-82a7-b61dfe686630n%40googlegroups.com.
I wondered about turning the gif into a video. This resulted in a significantly smaller file.
The mp4 file is 146 KB.
The original gif file is 355KB.
The zip file is 878KB.
from kivy.app import App
from kivy.lang import Builder
kv =
"""
BoxLayout:
orientation: 'vertical'
Video:
id: video
source: 'ezgif.com-gif-to-mp4.mp4'
options: {'eos': 'loop'}
on_kv_post: self.state = 'play'
# Image:
# source: 'ezgif-2-3826eb7bb9-gif-im.zip'
# anim_delay: .0667 # 15 fps
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/042d01d9e2ad%2460c84ee0%242258eca0%24%40cox.net.