【问题标题】:Why doesn't my Imagemagick convert consider the loop parameter?为什么我的 Imagemagick 转换不考虑循环参数?
【发布时间】:2017-03-19 10:05:55
【问题描述】:

我正在使用这个命令:

convert -delay 10 -loop 1 -density 300 myfile.pdf myfile.gif

在 Windows 10 上,除了循环参数外,其他一切都运行良好:即使我将其设置为 1,我总是会得到一个无限循环。

我做错了什么?

【问题讨论】:

    标签: imagemagick imagemagick-convert


    【解决方案1】:

    我做了一些实验,将 -loop 参数从 0 更改为 3,并使用简单的红框和蓝框,如下所示:

    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参数和-loop参数ARE正确设置在GIF文件中,虽然-loop被省略,如果它是1是默认的无论如何。

    然后我在 OSX 中使用 quicklook 功能查看了我的动画 GIF,您在 Finder 中点击 (空格键),但它不尊重 @987654329 @ 设置,但是,如果您在 SafariFirefox 中打开 GIF,它确实尊重该设置,所以我猜它不是很标准化,无论您用来查看什么GIF 文件不符合遵循不佳的标准。

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

    【讨论】:

    • 谢谢!你是对的,我用 Internet Explorer 打开它并且它可以工作,而用“Foto”(我不知道英文名称,我认为它是 Windows 10 自动关联到 .gif 文件的程序)它没有!
    猜你喜欢
    • 1970-01-01
    • 2020-02-18
    • 2017-04-26
    • 2018-05-14
    • 2023-01-30
    • 2023-04-03
    • 1970-01-01
    • 2021-06-23
    • 2016-05-25
    相关资源
    最近更新 更多