imageSize.php in Sassy 7
File
phamlp/sass/extensions/compass/functions/imageSize.php
View source
<?php
class SassExtentionsCompassFunctionsImageSize {
public function image_width($image_file) {
$image_size = getimagesize(self::real_path($image_file));
return new SassNumber($image_size[0] . 'px');
}
public function image_height($image_file) {
$image_size = getimagesize(self::real_path($image_file));
return new SassNumber($image_size[1] . 'px');
}
private function real_path($image_file) {
$path = $image_file->value;
if (SassExtentionsCompassConfig::config('images_path')) {
return SassExtentionsCompassConfig::config('images_path') . DIRECTORY_SEPARATOR . $path;
}
else {
return SassExtentionsCompassConfig::config('project_path') . DIRECTORY_SEPARATOR . $path;
}
}
}
Classes
Name |
Description |
SassExtentionsCompassFunctionsImageSize |
Compass extension SassScript image size functions class.
A collection of functions for use in SassSCript.
@package PHamlP
@subpackage Sass.extensions.compass.functions |