Getting frame count and delay between frames from gif using javascript

2.2k Views Asked by At

I am trying to know the frame count and delay between frames of a gif usign javascript, Without actualy parsing the gif with canvas, possibly from the its header.

After long search in Google, which return no results, I've tried to understand it from a gif parsign libraries such as 'giflib' with no success of understanding.

At the end I want to do it using simple code I cant include library to the existed code, Any other parsing tools wont be used at all, I just look for this specific parameters

Thanks.

1

There are 1 best solutions below

5
On

How about jsgif?

It allows you to parse an animated gif file with JavaScript and add some controls to it. With some modification you can change this to a counter of how many frames your gif file has?

Example of usage