Module: Gluttonberg::Library::AttachmentMixin

Included in:
Asset
Defined in:
lib/gluttonberg/library/attachment_mixin.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Constant Summary collapse

DEFAULT_THUMBNAILS =

Default sizes used when thumbnailing an image.

{
  :small_thumb => {:label => "Small Thumb", :filename => "_thumb_small", :geometry => "360x268#" },
  :large_thumb => {:label => "Large Thumb", :filename => "_thumb_large", :geometry => "360x268>"},
  :backend_logo => {:label => "Backend Logo", :filename => "_backend_logo", :geometry => "1000x30"}
}
MAX_IMAGE_SIZE =

The default max image size. This can be overwritten on a per project basis via the rails configuration.

"2000x2000>"

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

Resize image to have specified area in pixels. Aspect ratio is preserved.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/gluttonberg/library/attachment_mixin.rb', line 24

def self.included(klass)
  klass.class_eval do

    after_destroy  :remove_file_from_disk
    before_save    :generate_reference_hash

    extend ClassMethods
    include InstanceMethods

  end
end