ImageMagick identify reports incorrect GIF frame count

廉价感情. 提交于 2019-12-11 00:14:58

问题


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

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

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).

How can this possibly happen?

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?

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

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

The image in question:

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


回答1:


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.

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



来源:https://stackoverflow.com/questions/20530417/imagemagick-identify-reports-incorrect-gif-frame-count

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!