cache the image dimensions in sass options

This commit is contained in:
Scott Davis 2011-09-10 16:42:12 -04:00
parent 2367b9b9be
commit 45b19df315

View File

@ -45,7 +45,10 @@ module Compass::SassExtensions::Functions::ImageSize
private private
def image_demensions(image_file) 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 end
def image_path(image_file) def image_path(image_file)