You are here

image_size.inc in Sassy 7.2

File

extensions/compass/functions/image_size.inc
View source
<?php

function sassy_compass__image_width($file) {
  if ($info = sassy_compass__image_info($file)) {
    return new SassNumber($info[0] . 'px');
  }
  return new SassNumber('0px');
}
function sassy_compass__image_height($file) {
  if ($info = sassy_compass__image_info($file)) {
    return new SassNumber($info[1] . 'px');
  }
  return new SassNumber('0px');
}
function sassy_compass__image_info($file) {
  if ($path = sassy_compass__url($file, TRUE, FALSE)) {
    if ($info = getimagesize($path)) {
      return $info;
    }
  }
  return false;
}