summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/helpers/core_installer.php10
-rw-r--r--core/helpers/graphics.php11
2 files changed, 15 insertions, 6 deletions
diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php
index c83d9bcb..a1e06696 100644
--- a/core/helpers/core_installer.php
+++ b/core/helpers/core_installer.php
@@ -176,8 +176,14 @@ class core_installer {
module::set_var("core", "resize_size", 640);
// Add rules for generating our thumbnails and resizes
- graphics::add_rule("core", "thumb", "resize", array(200, 200, Image::AUTO), 100);
- graphics::add_rule("core", "resize", "resize", array(640, 640, Image::AUTO), 100);
+ graphics::add_rule(
+ "core", "thumb", "resize",
+ array("width" => 200, "height" => 200, "master" => Image::AUTO),
+ 100);
+ graphics::add_rule(
+ "core", "resize", "resize",
+ array("width" => 200, "height" => 200, "master" => Image::AUTO),
+ 100);
module::set_version("core", 1);
}
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);
}
/**