summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-04-22 19:50:38 +0000
committerBharat Mediratta <bharat@menalto.com>2009-04-22 19:50:38 +0000
commit33775f9fb013ae2c42265f562090a95c2995b919 (patch)
treeb3a952e2cdcd04d751bae4b5bd2650922e030db2
parent98d085e55f02dd19fde4fd3acda9037a9fe57bf4 (diff)
Throw an exception in graphics::resize() if the input file is empty
-rw-r--r--core/helpers/graphics.php4
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