Sha256: 1eee27bf2ea8f961ddc716512aace66777c0f47efa56f6621bf5fd065fe4206c

Contents?: true

Size: 615 Bytes

Versions: 22

Compression:

Stored size: 615 Bytes

Contents

module Dragonfly
  module ImageMagick
    module Generators
      class Plasma

        def call(content, width, height, opts={})
          format = extract_format(opts)
          content.generate!(:convert, "-size #{width}x#{height} plasma:fractal", format)
          content.add_meta('format' => format, 'name' => "plasma.#{format}")
        end

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

        private

        def extract_format(opts)
          opts['format'] || 'png'
        end

      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
dragonfly-1.3.0 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.2.1 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.2.0 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.1.5 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.1.4 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.1.3 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.1.2 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.1.1 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.1.0 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.12 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.11 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.10 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.9 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.8 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.7 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.6 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.5 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.4 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.3 lib/dragonfly/image_magick/generators/plasma.rb
dragonfly-1.0.2 lib/dragonfly/image_magick/generators/plasma.rb