FBpyGIF
FBpyGIF copied to clipboard
Aspect ratio/stretching
I have a gif that is 640x480 that I want to play on a 1920:1080 screen whilst maintaining aspect ratio. When I play this gif using FBpyGIF it stretches to fill the whole screen. Is there any way to play the gifs full screen whilst maintaining aspect ratio?
Here's the gif I'm using

And what it looks like in FBpyGIF (captured from a Raspberry Pi using a HDMI capture card, hence the fuzziness)

This is a cumbersome function to apply because it leaves a problem exactly where to put that smaller piece of image on the entire big framebuffer.
You can use virtual window function like FBpyGIF -w 0,0,640,480 [path...] if you just want it on the left top side of the screen.
However, if you want it on the center of screen instead, it gets complicated.
x1=W/2-w/2=(W-w)/2=(1920-640)/2=640
y1=H/2-h/2=(H-h)/2=(1080-480)/2=300
x2=W/2+w/2=(W+w)/2=(1920+640)/2=1280
y2=H/2+h/2=(H+h)/2=(1080+480)/2=780
Which means you need FBpyGIF -w 640,300,1280,780 [path...].
This kind of calculations should have been implemented before but since there's more efficient rust version comming, I'm not going to try to close this issue.
Additionally, this is left unsolved because you can use its nature to have many instances of background programs to create and fill those virtual windows differently, so that it seems like they're some composited window programs.