<commit_before><?php
/* SVN FILE: $Id: Phamlp_Sass_Script_Literal_Boolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
/**
 * Compass extension SassScript image size functions class file.
 * @author			<NAME> <<EMAIL>>
 * @copyright 	Copyright (c) 2010 PBM Web Development
 * @license			http://phamlp.googlecode.com/files/license.txt
 * @package			PHamlP
 * @subpackage	Sass.extensions.compass.functions
 */
 
/**
 * Compass extension SassScript image size functions class.
 * A collection of functions for use in SassSCript.
 * @package			PHamlP
 * @subpackage	Sass.extensions.compass.functions
 */
class Compass_Function_ImageSize {
	# Returns the $width of the image relative to the images directory
	public function image_width($image_file) {
		$image_size = getimagesize(static::real_path($image_file));
		return new Phamlp_Sass_Script_Literal_Number($image_size[0].'px');
	}

	# Returns the height of the image relative to the images directory
	public function image_height($image_file) {
		$image_size = getimagesize(static::real_path($image_file));
		return new Phamlp_Sass_Script_Literal_Number($image_size[1].'px');
	}

	private function real_path($image_file) {
		$path = $image_file->value;
		# Compute the real path to the image on the file stystem if the images_dir is set.
		if (Compass_Config::config('images_path'))
			return Compass_Config::config('images_path').DIRECTORY_SEPARATOR.$path;
		else
			return Compass_Config::config('project_path').DIRECTORY_SEPARATOR.$path;
	}
}<commit_msg>protected fix<commit_after><?php
/* SVN FILE: $Id: Phamlp_Sass_Script_Literal_Boolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
/**
 * Compass extension SassScript image size functions class file.
 * @author			<NAME> <<EMAIL>>
 * @copyright 	Copyright (c) 2010 PBM Web Development
 * @license			http://phamlp.googlecode.com/files/license.txt
 * @package			PHamlP
 * @subpackage	Sass.extensions.compass.functions
 */
 
/**
 * Compass extension SassScript image size functions class.
 * A collection of functions for use in SassSCript.
 * @package			PHamlP
 * @subpackage	Sass.extensions.compass.functions
 */
class Compass_Function_ImageSize {
	# Returns the $width of the image relative to the images directory
	public function image_width($image_file) {
		$image_size = getimagesize(static::real_path($image_file));
		return new Phamlp_Sass_Script_Literal_Number($image_size[0].'px');
	}

	# Returns the height of the image relative to the images directory
	public function image_height($image_file) {
		$image_size = getimagesize(static::real_path($image_file));
		return new Phamlp_Sass_Script_Literal_Number($image_size[1].'px');
	}

	protected function real_path($image_file) {
		$path = $image_file->value;
		# Compute the real path to the image on the file stystem if the images_dir is set.
		if (Compass_Config::config('images_path'))
			return Compass_Config::config('images_path').DIRECTORY_SEPARATOR.$path;
		else
			return Compass_Config::config('project_path').DIRECTORY_SEPARATOR.$path;
	}
}
{'fraction_non_alphanumeric': 0.11000662690523526, 'fraction_numerical': 0.0145791915175613, 'mean_word_length': 5.263485477178423, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5592792', 'n_tokens_mistral': 1036, 'n_tokens_neox': 964, 'n_words': 241}