Is there a simple way to get the duration of a gif?
like this gif is 4secs long?
Get gif duration?
Get gif duration?
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
Re: Get gif duration?
This is pretty simple using the Image library commands...
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
Re: Get gif duration?
You need to read the headers of each frame and add the DelayTimes.
Ok, to late.
Ok, to late.