Sha256: 3c4733275c384aa632de7fa09607272108d0677b99352f45ce94d2e38b40acbd

Contents?: true

Size: 363 Bytes

Versions: 6

Compression:

Stored size: 363 Bytes

Contents

require 'dimensions'

module RailsSassImages::Sass
  # Get image width
  def image_width(path)
    asset = RailsSassImages.asset(path)
    Sass::Script::Number.new(Dimensions.width(asset), ["px"])
  end

  # Get image height
  def image_height(path)
    asset = RailsSassImages.asset(path)
    Sass::Script::Number.new(Dimensions.height(asset), ["px"])
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails-sass-images-1.0.3 lib/rails-sass-images/sass/size.rb
rails-sass-images-1.0.2 lib/rails-sass-images/sass/size.rb
rails-sass-images-1.0.1 lib/rails-sass-images/sass/size.rb
rails-sass-images-1.0.0 lib/rails-sass-images/sass/size.rb
rails-sass-images-0.6 lib/rails-sass-images/sass/size.rb
rails-sass-images-0.5 lib/rails-sass-images/sass/size.rb