如何以毫秒为单位确定 .gif 动画的长度 [英] How to determine the length of a .gif animation in milliseconds

查看:42
本文介绍了如何以毫秒为单位确定 .gif 动画的长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法可以计算出 .gif 图像在 Javascript 中播放一次大约需要多长时间?

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

推荐答案

来自 identify 命令ImageMagick 可以提供以下信息:

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.

这篇关于如何以毫秒为单位确定 .gif 动画的长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆