ImageMagick识别报告错误的GIF帧数 [英] ImageMagick identify reports incorrect GIF frame count

查看:135
本文介绍了ImageMagick识别报告错误的GIF帧数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ImageMagick用GIF图像做一些事情。

I'm using ImageMagick to do some stuff with GIF images.

我的一个步骤是识别图像中的帧数。

我通过识别 node-imagemagick /rel =nofollow noreferrer> node-imagemagick (以及后来的 gm )像这样:

One of my steps is identifying the number of frames in an image.
I'm calling identify via node-imagemagick (and later gm) like this:

identify -format '%T,%w,%h ' test.gif

大多数情况下,我正确地为53帧提供53个以空格分隔的值。

有时我会为相同的GIF图像获得47或50帧(有53帧)。

Most of the time I correctly get 53 space-separated values for 53 frames.
But sometimes I get 47 or 50 frames for the same GIF image (that has 53 frames).

这怎么可能发生?

我正在同时运行 convert -coalesce -append test.gif other.gif ,但它不应该触摸原始图像,对吗?此外,我检查了原始图像,即使报告了错误的帧数,也没问题。

I'm running convert -coalesce -append test.gif other.gif at the same time, but it shouldn't touch the original image, right? Moreover I checked and the original image is just fine, even when wrong number of frames is reported.

我甚至无法一致地重现这一点。我在哪里寻找问题?

I can't even reproduce this consistently. Where do I look for the problem?

当我同时运行多个ImageMagick进程(在不同的文件上)时,这似乎就发生了。

This seems to happen when I'm running several ImageMagick processes concurrently (on different files).

我正在使用ImageMagick 6.8.7-9 Q16 x86_64 2013-12-11。

I'm using ImageMagick 6.8.7-9 Q16 x86_64 2013-12-11.

图像问题:

(但我发生过其他图像。)

(But I've had this happen to other images.)

推荐答案

这不是一个ImageMagick问题。

我将图像下载到服务器的代码有问题,总是跳过最后50个字节左右。

This was not an ImageMagick problem at all.
My code for downloading the image to the server was faulty, always skipping some last fifty bytes or so.

这个很容易错过,因为它不会严重影响GIF的质量。

This was too easy to miss because it didn't impact GIF's quality severely.

这篇关于ImageMagick识别报告错误的GIF帧数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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