From e204e18b3c6a4b4b1aa76b6d4a5392bd238490eb Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Sep 2009 20:28:26 -0700 Subject: Refactor the graphic rules processing to accomplish 2 goals: First separate the grapics library from module supplied rules and secondly, allow for modules to provide new processing rules callbacks. graphics::generate will now look for _graphics:: methods. --- modules/gallery/helpers/gallery_graphics.php | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 modules/gallery/helpers/gallery_graphics.php (limited to 'modules/gallery/helpers/gallery_graphics.php') diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php new file mode 100644 index 00000000..f62fbf97 --- /dev/null +++ b/modules/gallery/helpers/gallery_graphics.php @@ -0,0 +1,54 @@ +resize($options["width"], $options["height"], $options["master"]) + ->quality(module::get_var("gallery", "image_quality")); + if (graphics::can("sharpen")) { + $image->sharpen(module::get_var("gallery", "image_sharpen")); + } + $image->save($output_file); + } + + module::event("graphics_resize_completed", $input_file, $output_file, $options); + } +} -- cgit v1.2.3