class Dragonfly::ImageMagick::Generators::Plain

Public Instance Methods

call(content, width, height, opts={}) click to toggle source
# 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={}) click to toggle source
# 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

Private Instance Methods

extract_format(opts) click to toggle source
# File lib/dragonfly/image_magick/generators/plain.rb, line 19
def extract_format(opts)
  opts['format'] || 'png'
end