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/photo.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/gallery/helpers/photo.php') 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