From 660c5697db791f7269c1d9f5c15a51285cba86a9 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Thu, 15 Sep 2011 11:25:57 -0400 Subject: [PATCH] image_size was causing issue with rails and the sass evaluation context --- lib/compass/sass_extensions/functions/image_size.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/compass/sass_extensions/functions/image_size.rb b/lib/compass/sass_extensions/functions/image_size.rb index 43fea1ec..2a804930 100644 --- a/lib/compass/sass_extensions/functions/image_size.rb +++ b/lib/compass/sass_extensions/functions/image_size.rb @@ -47,11 +47,13 @@ private def image_demensions(image_file) options[:compass] ||= {} options[:compass][:image_dimensions] ||= {} - options[:compass][:image_dimensions][image_file.value] = ImageProperties.new(image_path(image_file.value)).size + options[:compass][:image_dimensions][image_file.value] = ImageProperties.new(image_path_for_size(image_file.value)).size end - def image_path(image_file) - return image_file if File.exists?(image_file) + def image_path_for_size(image_file) + if File.exists?(image_file) + return image_file + end real_path(image_file) end