diff options
-rw-r--r-- | lib/gallery.common.js | 14 | ||||
-rw-r--r-- | modules/gallery/helpers/graphics.php | 13 |
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 14c28a56..1eaa6db2 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -27,3 +27,17 @@ }); }; })(jQuery); + +// Get the viewport size +(function () { + $.getViewportSize = function() { + return { + width : function() { + return $(window).width(); + }, + height : function() { + return $(window).height(); + } + }; + }; +})(jQuery); 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); } /** |