How to determine the length of a .gif animation in milliseconds

后端 未结 3 1940
清酒与你
清酒与你 2021-01-13 22:19

Is there an easy way to figure out approximately how long a .gif image takes to play one time in Javascript?

3条回答
  •  情深已故
    2021-01-13 23:02

    The identify command from ImageMagick can give this information:

    $ identify -verbose file.gif | grep 'Elapsed time'
    
      Elapsed time: 0:01.080
      Elapsed time: 0:01.150
      Elapsed time: 0:01.230
    

    ...

      Elapsed time: 0:04.250
      Elapsed time: 0:04.330
      Elapsed time: 0:04.399
      Elapsed time: 0:04.480
    

    The last line printed should be the total length of the animation.

提交回复
热议问题