diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 2 | ||||
-rw-r--r-- | modules/gallery/controllers/quick.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_graphics.php | 18 | ||||
-rw-r--r-- | modules/gallery/helpers/graphics.php | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 5fd92972..22fb68c6 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -610,7 +610,7 @@ class g2_import_Core { if ($g2_preferred && $g2_preferred instanceof GalleryDerivative) { if (preg_match("/rotate\|(-?\d+)/", $g2_preferred->getDerivativeOperations(), $matches)) { $tmpfile = tempnam(TMPPATH, "rotate"); - gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $matches[1])); + gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $matches[1]), $item); $item->set_data_file($tmpfile); $item->save(); unlink($tmpfile); diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 17abc39f..da4768fd 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -38,7 +38,7 @@ class Quick_Controller extends Controller { if ($degrees) { $tmpfile = tempnam(TMPPATH, "rotate") . "." . pathinfo($item->file_path(), PATHINFO_EXTENSION); - gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $degrees)); + gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $degrees), $item); $item->set_data_file($tmpfile); $item->save(); unlink($tmpfile); diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php index e63b9336..1f47a65c 100644 --- a/modules/gallery/helpers/gallery_graphics.php +++ b/modules/gallery/helpers/gallery_graphics.php @@ -25,17 +25,17 @@ class gallery_graphics_Core { * @param string $output_file * @param array $options */ - static function rotate($input_file, $output_file, $options) { + static function rotate($input_file, $output_file, $options, $item) { graphics::init_toolkit(); - module::event("graphics_rotate", $input_file, $output_file, $options); + module::event("graphics_rotate", $input_file, $output_file, $options, $item); 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); + module::event("graphics_rotate_completed", $input_file, $output_file, $options, $item); } /** @@ -46,10 +46,10 @@ class gallery_graphics_Core { * @param string $output_file * @param array $options */ - static function resize($input_file, $output_file, $options) { + static function resize($input_file, $output_file, $options, $item) { graphics::init_toolkit(); - module::event("graphics_resize", $input_file, $output_file, $options); + module::event("graphics_resize", $input_file, $output_file, $options, $item); if (@filesize($input_file) == 0) { throw new Exception("@todo EMPTY_INPUT_FILE"); @@ -69,7 +69,7 @@ class gallery_graphics_Core { $image->save($output_file); } - module::event("graphics_resize_completed", $input_file, $output_file, $options); + module::event("graphics_resize_completed", $input_file, $output_file, $options, $item); } /** @@ -87,11 +87,11 @@ class gallery_graphics_Core { * @param string $output_file * @param array $options */ - static function composite($input_file, $output_file, $options) { + static function composite($input_file, $output_file, $options, $item) { try { graphics::init_toolkit(); - module::event("graphics_composite", $input_file, $output_file, $options); + module::event("graphics_composite", $input_file, $output_file, $options, $item); list ($width, $height) = getimagesize($input_file); list ($w_width, $w_height) = getimagesize($options["file"]); @@ -121,7 +121,7 @@ class gallery_graphics_Core { ->quality(module::get_var("gallery", "image_quality")) ->save($output_file); - module::event("graphics_composite_completed", $input_file, $output_file, $options); + module::event("graphics_composite_completed", $input_file, $output_file, $options, $item); } catch (ErrorException $e) { Kohana_Log::add("error", $e->get_message()); } diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 72c563b7..04501132 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -169,7 +169,7 @@ class graphics_Core { } foreach (self::_get_rules($target) as $rule) { - $args = array($working_file, $output_file, unserialize($rule->args)); + $args = array($working_file, $output_file, unserialize($rule->args), $item); call_user_func_array($rule->operation, $args); $working_file = $output_file; } |