Move these methods to the parent class for all to enjoy
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 28 May 2009 00:25:48 +0000 (20:25 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 28 May 2009 00:25:48 +0000 (20:25 -0400)
framework/Image/lib/Horde/Image.php
framework/Image/lib/Horde/Image/Im.php

index b1a48a3..6caf45a 100644 (file)
@@ -647,6 +647,18 @@ class Horde_Image
         return $this->_tmpdir;
     }
 
+    /**
+     * Utility function to zero out cached geometry information. Shouldn't
+     * really be called from client code, but is needed since Effects may need
+     * to clear these.
+     *
+     */
+    public function clearGeometry()
+    {
+        $this->_height = 0;
+        $this->_width = 0;
+    }
+
     protected function _logDebug($message)
     {
         if (!empty($this->_logger)) {
@@ -661,4 +673,26 @@ class Horde_Image
         }
     }
 
+    /**
+     * Return point size for font
+     */
+    public static function getFontSize($fontsize)
+    {
+        switch ($fontsize) {
+        case 'medium':
+            $point = 18;
+            break;
+        case 'large':
+            $point = 24;
+            break;
+        case 'giant':
+            $point = 30;
+            break;
+        default:
+            $point = 12;
+        }
+
+        return $point;
+    }
+
 }
\ No newline at end of file
index c6c943b..7055a6a 100644 (file)
@@ -693,30 +693,6 @@ class Horde_Image_Im extends Horde_Image
         @unlink($tmpout);
     }
 
-
-    /**
-     * Return point size for font
-     */
-    public static function getFontSize($fontsize)
-    {
-        switch ($fontsize) {
-        case 'medium':
-            $point = 18;
-            break;
-        case 'large':
-            $point = 24;
-            break;
-        case 'giant':
-            $point = 30;
-            break;
-        default:
-            $point = 12;
-        }
-
-        return $point;
-    }
-
-
     /**
      * Get the version of the convert command available. This needs to be
      * publicly visable since it's used by various Effects.