Reputation: 8521
How can I use rmagick to determine how many frames a remote GIF has?
Upvotes: 0
Views: 302
Reputation: 114158
You can use Magick::ImageList#length
:
Returns the number of images in the imagelist.
For example, this remote GIF:
has 12 frames:
require 'rmagick'
Magick::ImageList.new('https://i.giphy.com/zlLydol7ndM7C.gif').length
#=> 12
Upvotes: 3