Module: DynamicImage::ImageProcessor::Frames

Included in:
DynamicImage::ImageProcessor
Defined in:
lib/dynamic_image/image_processor/frames.rb

Overview

ImageProcessor::Frames

Support for animated GIF and WebP images, which vips represents as a single tall image with a page-height of one frame. Operations are applied to each frame and the results reassembled.

Instance Method Summary collapse

Instance Method Details

#frame(index) ⇒ DynamicImage::ImageProcessor

Extracts a single frame from a multi-frame image.

Parameters:

  • index (Integer)

    the frame to extract, zero based

Returns:



14
15
16
# File 'lib/dynamic_image/image_processor/frames.rb', line 14

def frame(index)
  apply extract_frame(index)
end

#frame_countInteger

Returns the number of frames. Still images have one.

Returns:

  • (Integer)


21
22
23
# File 'lib/dynamic_image/image_processor/frames.rb', line 21

def frame_count
  image.get("height") / size.y
end