From 187aa28931356d5b1b9789b5ae038fc0bd13bce7 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 19 Feb 2010 12:04:42 -0500 Subject: [PATCH] Catch and log errors --- ansel/lib/Image.php | 4 ++++ ansel/lib/ImageView/ShadowSharpThumb.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ansel/lib/Image.php b/ansel/lib/Image.php index a34fddc7a..6944c8044 100644 --- a/ansel/lib/Image.php +++ b/ansel/lib/Image.php @@ -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); } } diff --git a/ansel/lib/ImageView/ShadowSharpThumb.php b/ansel/lib/ImageView/ShadowSharpThumb.php index ffc994e9a..8929f411d 100644 --- a/ansel/lib/ImageView/ShadowSharpThumb.php +++ b/ansel/lib/ImageView/ShadowSharpThumb.php @@ -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) { -- 2.11.0