From: Michael J. Rubinsky Date: Mon, 15 Feb 2010 18:04:15 +0000 (-0500) Subject: Catch exceptions from Horde_Image here, log them, but move along. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a328430854798ecb5ac9e330899a264575e13aba;p=horde.git 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. --- 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;