From 2bfddc4c87443640098387630967f6d141a9fce6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 29 Dec 2008 20:20:10 +0000 Subject: Make graphics rules take named parameters. This will give us some flexibility in the future. --- core/helpers/graphics.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'core/helpers/graphics.php') diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index 8f0bb6a3..0a7dc250 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -93,7 +93,7 @@ class graphics_Core { ->where("target", $target) ->orderby("priority", "asc") ->find_all() as $rule) { - $args = array_merge(array($input_file, $output_file), unserialize($rule->args)); + $args = array($input_file, $output_file, unserialize($rule->args)); call_user_func_array(array("graphics", $rule->operation), $args); } } @@ -122,9 +122,9 @@ class graphics_Core { * @param integer $height * @param integer $master Master Dimension constant from the Image class */ - public static function resize($input_file, $output_file, $width, $height, $master) { + public static function resize($input_file, $output_file, $options) { Image::factory($input_file) - ->resize($width, $height, $master) + ->resize($options["width"], $options["height"], $options["master"]) ->save($output_file); } @@ -132,7 +132,10 @@ class graphics_Core { * Stub. * @todo implement this */ - public static function compose($input_file, $output_file, $other_args) { + public static function composite($input_file, $output_file, $options) { + Image::factory($input_file) + ->composite($options["file"], $options["mime_type"], 100, 100) + ->save($output_file); } /** -- cgit v1.2.3