为什么我的Imagemagick转换器不考虑循环参数?

时间:2016-11-05 18:42:47

标签: imagemagick imagemagick-convert

我正在使用此命令:

convert -delay 10 -loop 1 -density 300 myfile.pdf myfile.gif
在Windows 10上的

除了循环参数之外一切正常:即使我将其设置为1,我总是得到一个无限循环。

我做错了什么?

1 个答案:

答案 0 :(得分:1)

我做了一些实验,将0参数从0改为3,然后使用简单的红框,后跟蓝框,如下所示:

-loop

<强>结果

for i in 0 1 2 3; do 
   echo i=$i
   ((d=80+i))
   convert -delay $d -loop $i -size 256x256 xc:red xc:blue a.gif
   identify -verbose a.gif | grep -E "Iter|Delay"
done

因此,似乎i=0 Delay: 80x100 Iterations: 0 Delay: 80x100 Iterations: 0 i=1 Delay: 81x100 Delay: 81x100 i=2 Delay: 82x100 Iterations: 2 Delay: 82x100 Iterations: 2 i=3 Delay: 83x100 Iterations: 3 Delay: 83x100 Iterations: 3 参数和-delay参数 ARE 在GIF文件中正确设置,但如果-loop为{ {1}}无论如何都是默认值。

然后我使用-loop功能在OSX中查看了我的动画GIF,点按 Finder 中的(空格键),它不尊重1设置,但是,如果你在 Safari Firefox 中打开GIF,它确实尊重设置,所以我猜它不是很标准化而且你不管怎样用于查看GIF文件不符合标准不佳的标准。

我可能错了,但尝试使用其他浏览器,例如Firefox或Chrome。