Catch exceptions from Horde_Image here, log them, but move along.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 15 Feb 2010 18:04:15 +0000 (13:04 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 15 Feb 2010 18:04:15 +0000 (13:04 -0500)
Not much we can do about corrupt EXIF data, so just log it and move along.

ansel/lib/Image.php

index 7acc563..4b2af48 100644 (file)
@@ -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;