diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-04-22 19:50:38 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-04-22 19:50:38 +0000 |
commit | 33775f9fb013ae2c42265f562090a95c2995b919 (patch) | |
tree | b3a952e2cdcd04d751bae4b5bd2650922e030db2 | |
parent | 98d085e55f02dd19fde4fd3acda9037a9fe57bf4 (diff) |
Throw an exception in graphics::resize() if the input file is empty
-rw-r--r-- | core/helpers/graphics.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index c0ef98db..b409de47 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -153,6 +153,10 @@ class graphics_Core { self::init_toolkit(); } + if (filesize($input_file) == 0) { + throw new Exception("@todo MALFORMED_INPUT_FILE"); + } + $dims = getimagesize($input_file); if (max($dims[0], $dims[1]) < min($options["width"], $options["height"])) { // Image would get upscaled; do nothing |