Module: Gluttonberg::Library::Config::ImageSizes::ClassMethods
- Defined in:
- lib/gluttonberg/library/config/image_sizes.rb
Overview
Resize image to have specified area in pixels. Aspect ratio is preserved.
Instance Method Summary collapse
-
#max_image_size ⇒ Object
Returns the max image size as a hash containing :width and :height.
-
#sizes ⇒ Object
Returns a collection of thumbnail definitions — sizes, filename etc.
Instance Method Details
#max_image_size ⇒ Object
Returns the max image size as a hash containing :width and :height. May be the default, or the value configured for a particular project.
31 32 33 |
# File 'lib/gluttonberg/library/config/image_sizes.rb', line 31 def max_image_size Rails.configuration.max_image_size || MAX_IMAGE_SIZE end |
#sizes ⇒ Object
Returns a collection of thumbnail definitions — sizes, filename etc. — which is a merge of defaults and any custom thumbnails defined by the user.
21 22 23 24 25 26 27 |
# File 'lib/gluttonberg/library/config/image_sizes.rb', line 21 def sizes @thumbnail_sizes ||= if Rails.configuration.thumbnails Rails.configuration.thumbnails.merge(DEFAULT_THUMBNAILS) else DEFAULT_THUMBNAILS end end |