Class/Module Index [+]

Quicksearch

Compass::SassExtensions::Functions::ImageSize

Public Instance Methods

image_height(image_file) click to toggle source

Returns the height of the image relative to the images directory

# File lib/compass/sass_extensions/functions/image_size.rb, line 10
def image_height(image_file)
  image_path = real_path(image_file)
  height = ImageProperties.new(image_path).size.last
  Sass::Script::Number.new(height, ["px"])
end
image_width(image_file) click to toggle source

Returns the width of the image relative to the images directory

# File lib/compass/sass_extensions/functions/image_size.rb, line 3
def image_width(image_file)
  image_path = real_path(image_file)
  width = ImageProperties.new(image_path).size.first
  Sass::Script::Number.new(width,["px"])
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.