Class: BlurhashDecoder

Inherits:
Object
  • Object
show all
Includes:
DECODER
Defined in:
lib/blurhash_decoder.rb

Constant Summary collapse

VERSION =
"1.0"

Instance Method Summary collapse

Methods included from DECODER

#decode

Instance Method Details

#decode_blurhash(blurhash, height, width, punch) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/blurhash_decoder.rb', line 8

def decode_blurhash(blurhash, height, width, punch)
  decode(blurhash, height, width, punch)
  base64_image = File.open("tmp/out.png", "rb") do |file|
    Base64.strict_encode64(file.read)
  end
  base64_image
end