From abef6b5dab244ed9296ec5c157190c7f23af1ca4 Mon Sep 17 00:00:00 2001 From: colings Date: Mon, 21 Feb 2011 15:42:48 -0600 Subject: [PATCH] Updated modules that use graphics rules, and updated a couple that called gallery_graphics::resize directly. --- 3.1/modules/ecard/controllers/ecard.php | 4 ++-- 3.1/modules/max_size/helpers/max_size_event.php | 3 ++- .../rectangle_thumbs/helpers/rectangle_thumbs_graphics.php | 2 +- 3.1/modules/square_thumbs/helpers/square_thumbs_graphics.php | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/3.1/modules/ecard/controllers/ecard.php b/3.1/modules/ecard/controllers/ecard.php index 82777443..21a87080 100644 --- a/3.1/modules/ecard/controllers/ecard.php +++ b/3.1/modules/ecard/controllers/ecard.php @@ -62,11 +62,11 @@ class Ecard_Controller extends Controller { $tmpfile = tempnam(TMPPATH, "clean"); if($form->send_ecard->send_thumbnail->checked == true) { $options = array("width" => module::get_var("gallery", "thumb_size"), "height" => module::get_var("gallery", "thumb_size"), "master" => Image::AUTO); - gallery_graphics::resize($item->file_path(), $tmpfile, $options); + gallery_graphics::resize($item->file_path(), $tmpfile, $options, $item); $mime->addHTMLImage($tmpfile,$item->mime_type,$item->name); } else { $options = array("width" => module::get_var("gallery", "resize_size"), "height" => module::get_var("gallery", "resize_size"), "master" => Image::AUTO); - gallery_graphics::resize($item->file_path(), $tmpfile, $options); + gallery_graphics::resize($item->file_path(), $tmpfile, $options, $item); $mime->addHTMLImage($tmpfile,$item->mime_type,$item->name); } } else { diff --git a/3.1/modules/max_size/helpers/max_size_event.php b/3.1/modules/max_size/helpers/max_size_event.php index 4e1a69ae..be879e56 100644 --- a/3.1/modules/max_size/helpers/max_size_event.php +++ b/3.1/modules/max_size/helpers/max_size_event.php @@ -28,7 +28,8 @@ class max_size_event_Core { $tmpfile = $tempnam . "." . pathinfo($item->data_file, PATHINFO_EXTENSION); gallery_graphics::resize( $item->data_file, $tmpfile, - array("width" => $max_size, "height" => $max_size, "master" => Image::AUTO)); + array("width" => $max_size, "height" => $max_size, "master" => Image::AUTO), + $item); rename($tmpfile, $item->data_file); unlink($tempnam); } diff --git a/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php b/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php index fc431b46..63fd066f 100644 --- a/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php +++ b/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php @@ -27,7 +27,7 @@ class rectangle_thumbs_graphics_Core { * @param string $output_file * @param array $options */ - static function crop_to_aspect_ratio($input_file, $output_file, $options) { + static function crop_to_aspect_ratio($input_file, $output_file, $options, $item) { graphics::init_toolkit(); if (@filesize($input_file) == 0) { diff --git a/3.1/modules/square_thumbs/helpers/square_thumbs_graphics.php b/3.1/modules/square_thumbs/helpers/square_thumbs_graphics.php index a8641039..32a0b28a 100644 --- a/3.1/modules/square_thumbs/helpers/square_thumbs_graphics.php +++ b/3.1/modules/square_thumbs/helpers/square_thumbs_graphics.php @@ -25,7 +25,7 @@ class square_thumbs_graphics_Core { * @param string $output_file * @param array $options */ - static function crop_to_square($input_file, $output_file, $options) { + static function crop_to_square($input_file, $output_file, $options, $item) { graphics::init_toolkit(); if (@filesize($input_file) == 0) {