Get gif duration?
Posted: Tue Aug 13, 2024 8:34 pm
Is there a simple way to get the duration of a gif?
like this gif is 4secs long?
like this gif is 4secs long?
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
UseGIFImageDecoder()
gif=LoadImage(#PB_Any,"mygif.gif")
If gif
frames=ImageFrameCount(gif)
If frames>1
For idx=1 To frames
SetImageFrame(gif,idx-1)
delay+GetImageFrameDelay(gif)
Next
EndIf
Debug "Frames: "+frames
Debug "Total ms: "+delay
FreeImage(gif)
EndIf