Animated GIF files - how to locate on disk

Alan Pope popey at ubuntu.com
Fri Nov 12 09:56:46 UTC 2010


On 12 November 2010 09:47, Bhavani Shankar R <bhavi at ubuntu.com> wrote:
> On Fri, Nov 12, 2010 at 2:59 PM, ANDY <sirald66 at gmail.com> wrote:
>> I have a bunch of GIF files and I need to find/separate the animated GIF
>> files.
>>
>> What Ubuntu tool/command can find them?
>>
>>
>
> Simple mate
>
> You can use locate command
>
> locate *gif [RET]
>

The OP specifically asked about finding animated gif files. Yours and
Basils suggestions will find gif files whether animated or not.

I suspect the solution would require querying each file using a tool
such as imagemagick to see if it's animated or not.

This could be wrapped in a shell script.

For example the "identify" command will let you know when a gif is
animated by producing a line per frame of the animation.

e.g.


alan at mrevo:~/images$ identify 478px-Seven_segment_display-animated.gif
478px-Seven_segment_display-animated.gif[0] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.000
478px-Seven_segment_display-animated.gif[1] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[2] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[3] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[4] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[5] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[6] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[7] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[8] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[9] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[10] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[11] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[12] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[13] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[14] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009
478px-Seven_segment_display-animated.gif[15] GIF 478x599 478x599+0+0
8-bit PseudoClass 64c 119KB 0.000u 0:00.009

Compare that with a non-animated gif.


alan at mrevo:~/images$ identify sample.gif
sample.gif GIF 421x304 421x304+0+0 8-bit PseudoClass 256c 98.1KB 0.000u 0:00.000


Cheers,
Al.




More information about the ubuntu-users mailing list