Background image in custom panel

Hi @peter, any thoughts on this?

Awhile back, when I was first working on the Big Temp mod, I had a custom background of an animated gif. This worked for me for quite awhile until I upgraded my version of the Raspbian OS. I’m on Bookworm now, and can’t get a gif to load. I can load a png, but not the animated gif.

Here is the code I’m using for the png. When I replace the file with a .gif, I get the error.

The error just says “[ERROR ] [Image ] Error loading <user/RadarGIF/radar.gif>”

The file is present and when it can’t find the file, it says Not found.

customPanels.kv
:
PanelBackground:
_panelTitle: ‘RadarGIF’
Image:
id: RadarGIFBackground
source: ‘user/RadarGIF/radar.png’
size_hint: (1,1)
keep_ratio: 1
allow_stretch: 0

:
PanelButton:
text: ‘RadarGIF’
on_release: app.CurrentConditions.switchPanel(self)

customPanel.py
class RadarGIFPanel(panelTemplate):
def init(self, **kwargs):
super().init(**kwargs)
Clock.schedule_interval(self.updateImage, 600)

def updateImage(self,dt):
    self.ids.RadarGIFBackground.reload()

class RadarGIFButton(RelativeLayout):
pass

-rw-r–r-- 1 pi pi 414744 Apr 13 16:40 radar.gif

Take a look at this thread here: https://groups.google.com/g/kivy-users/c/isIwfZrfyH0

It sounds like there may be an issue loading gif files in particular formats. A suggested workaround in the second post is to animate a zip file containing the individual images

Thank you for the thread. I’ll use that to explore some options.

I ended up creating my own animation process. I download the weather radar gif every 10 minutes and extract the frames into 10 png files. I set the background image to radar.png, and in the background, a script is updating a symlink to the radar.png every 2 seconds to iterate through the frames. I set the refresh rate on the panel reload image to every 2 seconds. It gives the appearance of animation pretty well.

1 Like