diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-07-31 13:32:07 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-07-31 13:32:07 -0700 |
commit | f034c6c534ad6a07dacc6e64c7e6b43f139c3831 (patch) | |
tree | 8f208e5288262fdae690dd80605f823e9ebbfbe6 | |
parent | 86c7fabeaf6fcc9fbbdf1c1a7dc2a3cf9c9a6366 (diff) |
Add new events:
graphics_resize
graphics_resize_completed
graphics_rotate
graphics_rotate_completed
graphics_composite
graphics_composite_completed
-rw-r--r-- | modules/gallery/helpers/graphics.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index db9b2ef5..d506a982 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -195,6 +195,8 @@ class graphics_Core { self::init_toolkit(); } + module::event("graphics_resize", $input_file, $output_file, $options); + if (@filesize($input_file) == 0) { throw new Exception("@todo EMPTY_INPUT_FILE"); } @@ -209,6 +211,8 @@ class graphics_Core { ->quality(module::get_var("gallery", "image_quality")) ->save($output_file); } + + module::event("graphics_resize_completed", $input_file, $output_file, $options); } /** @@ -223,10 +227,14 @@ class graphics_Core { 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); } /** @@ -249,6 +257,8 @@ class graphics_Core { self::init_toolkit(); } + module::event("graphics_composite", $input_file, $output_file, $options); + list ($width, $height) = getimagesize($input_file); list ($w_width, $w_height) = getimagesize($options["file"]); @@ -276,6 +286,9 @@ class graphics_Core { ->composite($options["file"], $x, $y, $options["transparency"]) ->quality(module::get_var("gallery", "image_quality")) ->save($output_file); + + + module::event("graphics_composite_completed", $input_file, $output_file, $options); } /** |