目前我们使用秒表来确定 gif 横幅上动画的总持续时间。
已经引用了imagemagick的解决方案-How to determine the length of a .gif animation in milliseconds
示例 gif 横幅: http://i.stack.imgur.com/JTz79.gif
实际数据:-
迭代次数 = 20
持续时间 - 第 1 帧 = 0.5 秒
持续时间 - 第 2 帧 = 0.5 秒
总时间 = 20*(0.5+0.5) = 20 秒
ImageMagick 提供的统计数据:-
使用 - identify -verbose betsy.gif | grep -E 'Iterations|Elapsed'
迭代次数:19
已用时间:0:01.000
耗时:0:01.040
总时间 = 1.040*19 = 19.76 秒
有没有其他方法(除了使用物理秒表)以编程方式找到动画的确切持续时间?
最佳答案
使用 exiftool 像:
$ exiftool splash.gif
ExifTool Version Number : 11.76
File Name : splash.gif
Directory : .
File Size : 1062 kB
File Modification Date/Time : 2020:06:18 10:04:16+02:00
File Access Date/Time : 2020:06:18 09:51:54+02:00
File Inode Change Date/Time : 2020:06:18 10:04:16+02:00
File Permissions : rw-r--r--
File Type : GIF
File Type Extension : gif
MIME Type : image/gif
GIF Version : 89a
Image Width : 950
Image Height : 140
Has Color Map : Yes
Color Resolution Depth : 1
Bits Per Pixel : 1
Background Color : 0
Animation Iterations : Infinite
Frame Count : 149
Duration : 4.96 s
Image Size : 950x140
Megapixels : 0.133
您可以在几秒钟内找到持续时间。
关于animation - gif 动画的总持续时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35007390/