cache the image dimensions in sass options
This commit is contained in:
parent
2367b9b9be
commit
45b19df315
@ -45,7 +45,10 @@ module Compass::SassExtensions::Functions::ImageSize
|
||||
private
|
||||
|
||||
def image_demensions(image_file)
|
||||
ImageProperties.new(image_path(image_file.value)).size
|
||||
options[:custom] ||= {}
|
||||
options[:custom][:compass] ||= {}
|
||||
options[:custom][:compass][:image_dimensions] ||= {}
|
||||
options[:custom][:compass][:image_dimensions][image_file.value] = ImageProperties.new(image_path(image_file.value)).size
|
||||
end
|
||||
|
||||
def image_path(image_file)
|
||||
|
Loading…
Reference in New Issue
Block a user