Class: Dragonfly::ImageMagick::Generators::Plain

Inherits:
Object
  • Object
show all
Defined in:
lib/dragonfly/image_magick/generators/plain.rb

Instance Method Summary collapse

Instance Method Details

#call(content, width, height, opts = {}) ⇒ Object



6
7
8
9
10
11
# File 'lib/dragonfly/image_magick/generators/plain.rb', line 6

def call(content, width, height, opts={})
  format = extract_format(opts)
  colour = opts['colour'] || opts['color'] || 'white'
  content.generate!(:convert, "-size #{width}x#{height} xc:#{colour}", format)
  content.add_meta('format' => format, 'name' => "plain.#{format}")
end

#update_url(url_attributes, width, height, opts = {}) ⇒ Object



13
14
15
# File 'lib/dragonfly/image_magick/generators/plain.rb', line 13

def update_url(url_attributes, width, height, opts={})
  url_attributes.name = "plain.#{extract_format(opts)}"
end