# typed: strict
# frozen_string_literal: true

class LoadedMedia::StaticImage < LoadedMedia
  sig { params(media_path: String).void }
  def initialize(media_path)
    @vips_image = T.let(Vips::Image.new_from_file(media_path), Vips::Image)
  end

  sig { override.returns(Integer) }
  def num_frames
    1
  end

  sig do
    override
      .params(frame: Integer, path: String, options: ThumbnailOptions)
      .void
  end
  def write_frame_thumbnail(frame, path, options)
    write_image_thumbnail(@vips_image, path, options)
  end
end
