Class: Teaas::Got

Inherits:
Object
  • Object
show all
Defined in:
lib/teaas/got.rb

Class Method Summary collapse

Class Method Details

.got(original_img) ⇒ Magick::ImageList

Best when used with Turboize.turbo to generate multiple rotation speeds.

Parameters:

  • original_img (Magick::ImageList)

    The original image

Returns:

  • (Magick::ImageList)

    The resulting image



7
8
9
10
# File 'lib/teaas/got.rb', line 7

def self.got(original_img)
  fire_img = Overlayer.overlay(original_img, Magick::ImageList.new(Teaas.root + "/img/fire.gif"))
  Overlayer.overlay(fire_img, Magick::ImageList.new(Teaas.root + "/img/blood.gif"), :whitelisted_animation => true)
end

.got_from_file(path) ⇒ Magick::ImageList

Best when used with Turboize.turbo to generate multiple rotation speeds. This is a wrapper around got

Parameters:

  • path (String)

    Path to the image to be spun

Returns:

  • (Magick::ImageList)

    The spinning image



16
17
18
19
20
21
22
23
24
# File 'lib/teaas/got.rb', line 16

def self.got_from_file(path)
  img = Magick::ImageList.new

  # Grab the first element in array to prevent strange things when an
  # animated image is submitted
  img.read(path)[0]

  got(img)
end