Module: Shrine::Plugins::Thumbhash::ClassMethods

Defined in:
lib/shrine/plugins/thumbhash.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#generate_thumbhash(io) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/shrine/plugins/thumbhash.rb', line 40

def generate_thumbhash(io)
  image = opts[:thumbhash][:image_loader].call(io)

  ::ThumbHash.rgba_to_thumb_hash(
    image.width,
    image.height,
    image.pixels
  )
end