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/helpers/gallery_graphics.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules/gallery/helpers/gallery_graphics.php') 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. -- cgit v1.2.3