moved to private
This commit is contained in:
parent
abace68275
commit
7f8b6c29e0
@ -5,16 +5,6 @@ module Compass::SassExtensions::Functions::ImageSize
|
|||||||
Sass::Script::Number.new(width,["px"])
|
Sass::Script::Number.new(width,["px"])
|
||||||
end
|
end
|
||||||
|
|
||||||
def image_demensions(image_file)
|
|
||||||
@image_demensions ||= {}
|
|
||||||
@image_demensions[image_file.value] ||= ImageProperties.new(image_path(image_file.value)).size
|
|
||||||
end
|
|
||||||
|
|
||||||
def image_path(image_file)
|
|
||||||
return image_file if File.exists?(image_file)
|
|
||||||
real_path(image_file)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the height of the image relative to the images directory
|
# Returns the height of the image relative to the images directory
|
||||||
def image_height(image_file)
|
def image_height(image_file)
|
||||||
_, height = image_demensions(image_file)
|
_, height = image_demensions(image_file)
|
||||||
@ -54,6 +44,16 @@ module Compass::SassExtensions::Functions::ImageSize
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def image_demensions(image_file)
|
||||||
|
@image_demensions ||= {}
|
||||||
|
@image_demensions[image_file.value] ||= ImageProperties.new(image_path(image_file.value)).size
|
||||||
|
end
|
||||||
|
|
||||||
|
def image_path(image_file)
|
||||||
|
return image_file if File.exists?(image_file)
|
||||||
|
real_path(image_file)
|
||||||
|
end
|
||||||
|
|
||||||
def real_path(image_file)
|
def real_path(image_file)
|
||||||
# Compute the real path to the image on the file stystem if the images_dir is set.
|
# Compute the real path to the image on the file stystem if the images_dir is set.
|
||||||
if Compass.configuration.images_path
|
if Compass.configuration.images_path
|
||||||
|
Loading…
Reference in New Issue
Block a user