Fix some phpdoc, get rid of some lingering PEAR_Error usage
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 5 Sep 2010 17:29:40 +0000 (13:29 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 5 Sep 2010 17:29:40 +0000 (13:29 -0400)
framework/Image/lib/Horde/Image/Effect/Gd/TextWatermark.php
framework/Image/lib/Horde/Image/Gd.php

index ed3e5f6..68381cc 100644 (file)
@@ -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;
index 711ff71..8b2a3d8 100644 (file)
@@ -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)
     {