From a328430854798ecb5ac9e330899a264575e13aba Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 15 Feb 2010 13:04:15 -0500 Subject: [PATCH] Catch exceptions from Horde_Image here, log them, but move along. Not much we can do about corrupt EXIF data, so just log it and move along. --- ansel/lib/Image.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ansel/lib/Image.php b/ansel/lib/Image.php index 7acc56343..4b2af48c0 100644 --- a/ansel/lib/Image.php +++ b/ansel/lib/Image.php @@ -568,7 +568,15 @@ class Ansel_Image return $imageFile; } $exif = Horde_Image_Exif::factory($GLOBALS['conf']['exif']['driver'], !empty($GLOBALS['conf']['exif']['params']) ? $GLOBALS['conf']['exif']['params'] : array()); - $exif_fields = $exif->getData($imageFile); + + try { + $exif_fields = $exif->getData($imageFile); + } catch (Horde_Image_Exception $e) { + // Log the error, but it's not the end of the world, so just ignore + Horde::logMessage($e->getMessage, __FILE__, __LINE__, PEAR_LOG_ERR); + $exif_fields = array(); + return false; + } /* Flag to determine if we need to resave the image data */ $needUpdate = false; -- 2.11.0