From 33775f9fb013ae2c42265f562090a95c2995b919 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 22 Apr 2009 19:50:38 +0000 Subject: Throw an exception in graphics::resize() if the input file is empty --- core/helpers/graphics.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/helpers') 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 -- cgit v1.2.3