diff options
author | Bharat Mediratta <bharat@menalto.com> | 2013-02-09 10:35:04 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-02-09 10:35:04 -0800 |
commit | 7613d886f98299c36d667908c52401bd07eef1e0 (patch) | |
tree | a31c4425c6a18a2691b3bf33f86c6a0dcff27689 /modules/gallery/helpers/graphics.php | |
parent | f4ecb7e65850ca0cac9f7d963c34f7cd20ee9446 (diff) | |
parent | 0312d1b071bd4434ddb3f82888b0323da6bf3732 (diff) |
Merge pull request #128 from shadlaws/fix_1994
#1994 - Make get_file_metadata throw an exception if photo or movie is unidentifiable/illegal.
Diffstat (limited to 'modules/gallery/helpers/graphics.php')
-rw-r--r-- | modules/gallery/helpers/graphics.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 4df57fba..e34af018 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -224,7 +224,16 @@ class graphics_Core { graphics::_replace_image_with_placeholder($item, "resize"); } graphics::_replace_image_with_placeholder($item, "thumb"); - graphics::_update_item_dimensions($item); + try { + graphics::_update_item_dimensions($item); + } catch (Exception $e) { + // Looks like get_file_metadata couldn't identify our placeholders. We should never get + // here, but in the odd case we do, we need to do something. Let's put in hardcoded values. + if ($item->is_photo()) { + list ($item->resize_width, $item->resize_height) = array(200, 200); + } + list ($item->thumb_width, $item->thumb_height) = array(200, 200); + } $item->save(); throw $e; } |