From 4627e816c4bbcde7e66cd2d3a37164ec3e0c6f14 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sun, 5 Sep 2010 13:29:40 -0400 Subject: [PATCH] Fix some phpdoc, get rid of some lingering PEAR_Error usage --- framework/Image/lib/Horde/Image/Effect/Gd/TextWatermark.php | 12 ++++-------- framework/Image/lib/Horde/Image/Gd.php | 7 +++++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/framework/Image/lib/Horde/Image/Effect/Gd/TextWatermark.php b/framework/Image/lib/Horde/Image/Effect/Gd/TextWatermark.php index ed3e5f6ef..68381ccdc 100644 --- a/framework/Image/lib/Horde/Image/Effect/Gd/TextWatermark.php +++ b/framework/Image/lib/Horde/Image/Effect/Gd/TextWatermark.php @@ -71,20 +71,16 @@ class Horde_Image_Effect_Gd_TextWatermark extends Horde_Image_Effect switch ($this->_params['halign']) { case 'right': foreach ($lines as $line) { - if (is_a($result = $this->_image->call('imageString', array($this->_image->_im, $f, ($this->_image->call('imageSX', array($this->_image->_im)) - $fontwidth * strlen($line)) - $margin + $drop, ($y + $drop), $line, $shadow)), 'PEAR_Error')) { - return $result; - } - $result = $this->_image->call('imageString', array($this->_image->_im, $f, ($this->_image->call('imageSX', array($this->_image->_im)) - $fontwidth * strlen($line)) - $margin, $y, $line, $color)); + $this->_image->call('imageString', array($this->_image->_im, $f, ($this->_image->call('imageSX', array($this->_image->_im)) - $fontwidth * strlen($line)) - $margin + $drop, ($y + $drop), $line, $shadow)); + $this->_image->call('imageString', array($this->_image->_im, $f, ($this->_image->call('imageSX', array($this->_image->_im)) - $fontwidth * strlen($line)) - $margin, $y, $line, $color)); $y += $fontheight; } break; case 'center': foreach ($lines as $line) { - if (is_a($result = $this->_image->call('imageString', array($this->_image->_im, $f, floor(($this->_image->call('imageSX', array($this->_image->_im)) - $fontwidth * strlen($line)) / 2) + $drop, ($y + $drop), $line, $shadow)), 'PEAR_Error')) { - return $result; - } - $result = $this->_image->call('imageString', array($this->_image->_im, $f, floor(($this->_image->call('imageSX', array($this->_image->_im)) - $fontwidth * strlen($line)) / 2), $y, $line, $color)); + $this->_image->call('imageString', array($this->_image->_im, $f, floor(($this->_image->call('imageSX', array($this->_image->_im)) - $fontwidth * strlen($line)) / 2) + $drop, ($y + $drop), $line, $shadow)); + $this->_image->call('imageString', array($this->_image->_im, $f, floor(($this->_image->call('imageSX', array($this->_image->_im)) - $fontwidth * strlen($line)) / 2), $y, $line, $color)); $y += $fontheight; } break; diff --git a/framework/Image/lib/Horde/Image/Gd.php b/framework/Image/lib/Horde/Image/Gd.php index 711ff7186..8b2a3d834 100644 --- a/framework/Image/lib/Horde/Image/Gd.php +++ b/framework/Image/lib/Horde/Image/Gd.php @@ -176,6 +176,9 @@ class Horde_Image_Gd extends Horde_Image_Base * * @param string $id An arbitrary id for the image. * @param string $image_data The data to use for the image. + * + * @return void + * @throws Horde_Image_Exception */ public function loadString($image_data) { @@ -189,8 +192,8 @@ class Horde_Image_Gd extends Horde_Image_Base * the image data from. The filename will also be * used for the image id. * - * @return mixed true on success | PEAR Error if file does not exist or - * could not be loaded. + * @return boolean + * @throws Horde_Image_Exception */ public function loadFile($filename) { -- 2.11.0