Module: Compass::Core::SassExtensions::Functions::ImageSize
- Included in:
- Sass::Script::Functions
- Defined in:
- lib/compass/core/sass_extensions/functions/image_size.rb
Defined Under Namespace
Classes: ImageProperties, JPEG
Constant Summary collapse
- KNOWN_TYPES =
%w(png gif jpg jpeg)
Instance Method Summary collapse
-
#image_height(image_file) ⇒ Object
Returns the height of the image relative to the images directory.
-
#image_width(image_file) ⇒ Object
Returns the width of the image relative to the images directory.
Instance Method Details
#image_height(image_file) ⇒ Object
Returns the height of the image relative to the images directory
11 12 13 14 |
# File 'lib/compass/core/sass_extensions/functions/image_size.rb', line 11 def image_height(image_file) _, height = image_dimensions(image_file) number(height, "px") end |
#image_width(image_file) ⇒ Object
Returns the width of the image relative to the images directory
5 6 7 8 |
# File 'lib/compass/core/sass_extensions/functions/image_size.rb', line 5 def image_width(image_file) width, _ = image_dimensions(image_file) number(width, "px") end |