From c7aafef85279114a8ae8855647394bb26400b3de Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 7 Jun 2009 17:48:42 -0700 Subject: Improve error handling support for corrupt images and report them appropriately in g2_import. --- modules/gallery/helpers/graphics.php | 7 +++---- modules/gallery/helpers/photo.php | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 4846fa8a..25eb0891 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -166,12 +166,11 @@ class graphics_Core { $item->resize_dirty = 0; } $item->save(); - } catch (Kohana_Exception $e) { + } catch (Exception $e) { // Something went wrong rebuilding the image. Leave it dirty and move on. // @todo we should handle this better. Kohana::log("error", "Caught exception rebuilding image: {$item->title}\n" . - $e->getMessage() . "\n" . - $e->getTraceAsString()); + $e->getMessage() . "\n" . $e->getTraceAsString()); return false; } @@ -192,7 +191,7 @@ class graphics_Core { } if (filesize($input_file) == 0) { - throw new Exception("@todo MALFORMED_INPUT_FILE"); + throw new Exception("@todo EMPTY_INPUT_FILE"); } $dims = getimagesize($input_file); diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index c1c005f5..a4bc853b 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -53,6 +53,10 @@ class photo_Core { throw new Exception("@todo NAME_CANNOT_END_IN_PERIOD"); } + if (filesize($filename) == 0) { + throw new Exception("@todo EMPTY_INPUT_FILE"); + } + $image_info = getimagesize($filename); // Force an extension onto the name -- cgit v1.2.3 From f0ca27ab924c06cc72a44d66498b86aeda672b33 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 8 Jun 2009 21:31:50 -0700 Subject: Fix the admin/themes url. --- modules/gallery/views/admin_block_welcome.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/admin_block_welcome.html.php b/modules/gallery/views/admin_block_welcome.html.php index 488fa908..a453b006 100644 --- a/modules/gallery/views/admin_block_welcome.html.php +++ b/modules/gallery/views/admin_block_welcome.html.php @@ -10,7 +10,7 @@
  • choose a theme, or customize the way it looks.", - array("theme_url" => url::site("admin/theme"), + array("theme_url" => url::site("admin/themes"), "theme_details_url" => url::site("admin/theme_details"))) ?>
  • -- cgit v1.2.3 From e6768a4e9771f5f751d74001ce3a0d33f6775216 Mon Sep 17 00:00:00 2001 From: unostar Date: Mon, 8 Jun 2009 17:51:56 +0800 Subject: Add string to localizer Signed-off-by: Bharat Mediratta --- modules/gallery/views/simple_uploader.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index 79919d50..f10d764c 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -93,7 +93,7 @@ button_width: "202", button_height: "45", button_placeholder_id: "gChooseFilesButtonPlaceholder", - button_text: 'Select photos...', + button_text: '', button_text_style: ".swfUploadFont { color: #2E6E9E; font-size: 16px; font-family: Lucida Grande,Lucida Sans,Arial,sans-serif; font-weight: bold; }", button_text_left_padding: 30, button_text_top_padding: 10, -- cgit v1.2.3 From d2b8ca241d6b2a1c1a512c731721b738e719d613 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Tue, 9 Jun 2009 00:25:49 -0600 Subject: Show status message when album cover is set (#257) --- modules/gallery/controllers/quick.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 6efcb9de..d6f5213f 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -87,9 +87,12 @@ class Quick_Controller extends Controller { access::required("view", $item->parent()); access::required("edit", $item->parent()); + $msg = t("Made %title this album's cover", array("title" => $item->title)); + item::make_album_cover($item); + message::success($msg); - print json_encode(array("result" => "success")); + print json_encode(array("result" => "success", "reload" => 1)); } public function delete($id) { -- cgit v1.2.3