From dc0d344b4acb7a7d7d60628d5928163bf121ab1a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 6 Oct 2009 12:58:53 -0700 Subject: Move the graphics::rotate to gallery_graphics::rotate to be consistent with the other gallery graphics functions. --- modules/gallery/controllers/quick.php | 3 ++- modules/gallery/helpers/gallery_graphics.php | 20 ++++++++++++++++++++ modules/gallery/helpers/graphics.php | 22 ---------------------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 2ac54754..a1e7dcc3 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -36,7 +36,8 @@ class Quick_Controller extends Controller { } if ($degrees) { - graphics::rotate($item->file_path(), $item->file_path(), array("degrees" => $degrees)); + gallery_graphics::rotate($item->file_path(), $item->file_path(), + array("degrees" => $degrees)); list($item->width, $item->height) = getimagesize($item->file_path()); $item->resize_dirty= 1; diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php index bdd600c5..c24d2bde 100644 --- a/modules/gallery/helpers/gallery_graphics.php +++ b/modules/gallery/helpers/gallery_graphics.php @@ -18,6 +18,26 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_graphics_Core { + /** + * Rotate an image. Valid options are degrees + * + * @param string $input_file + * @param string $output_file + * @param array $options + */ + static function rotate($input_file, $output_file, $options) { + graphics::init_toolkit(); + + module::event("graphics_rotate", $input_file, $output_file, $options); + + Image::factory($input_file) + ->quality(module::get_var("gallery", "image_quality")) + ->rotate($options["degrees"]) + ->save($output_file); + + module::event("graphics_rotate_completed", $input_file, $output_file, $options); + } + /** * Resize an image. Valid options are width, height and master. Master is one of the Image * master dimension constants. diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index ecddd86b..1063c073 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -192,28 +192,6 @@ class graphics_Core { return self::$_rules_cache[$target]; } - /** - * Rotate an image. Valid options are degrees - * - * @param string $input_file - * @param string $output_file - * @param array $options - */ - static function rotate($input_file, $output_file, $options) { - if (!self::$init) { - self::init_toolkit(); - } - - module::event("graphics_rotate", $input_file, $output_file, $options); - - Image::factory($input_file) - ->quality(module::get_var("gallery", "image_quality")) - ->rotate($options["degrees"]) - ->save($output_file); - - module::event("graphics_rotate_completed", $input_file, $output_file, $options); - } - /** * Return a query result that locates all items with dirty images. * @return Database_Result Query result -- cgit v1.2.3