Catch and log errors
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 19 Feb 2010 17:04:42 +0000 (12:04 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 19 Feb 2010 17:04:42 +0000 (12:04 -0500)
ansel/lib/Image.php
ansel/lib/ImageView/ShadowSharpThumb.php

index a34fddc..6944c80 100644 (file)
@@ -409,6 +409,9 @@ class Ansel_Image Implements Iterator
             if ($view == 'prettythumb') {
                 // If we still fail, the exception gets thrown up the chain.
                 $iview = Ansel_ImageView::factory('Thumb', array('image' => $this, 'style' => 'ansel_default'));
+            } else {
+                // If it wasn't a prettythumb, then something else must be wrong
+                throw $e;
             }
         }
 
@@ -1086,6 +1089,7 @@ class Ansel_Image Implements Iterator
         try {
             $this->_image->addEffect($type, $params);
         } catch (Horde_Image_Exception $e) {
+            Horde::logMessage($e->getMessage(), __FILE__, __LINE__, PEAR_LOG_DEBUG);
             throw new Ansel_Exception($e);
         }
     }
index ffc994e..8929f41 100644 (file)
@@ -30,11 +30,11 @@ class Ansel_ImageView_ShadowSharpThumb extends Ansel_ImageView
             }
 
             try {
-                $this->_image->addEffect('border', array('bordercolor' => '#333'));
+                $this->_image->addEffect('Border', array('bordercolor' => '#333', 'borderwidth' => 1));
                 $this->_image->addEffect('DropShadow',
                                          array('background' => $styleDef['background'],
                                                'padding' => 5,
-                                               'distance' => '8',
+                                               'distance' => 8,
                                                'fade' => 2));
                 $this->_image->applyEffects();
             } catch (Horde_Image_Exception $e) {