Fix case for file names
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 31 May 2010 00:46:41 +0000 (20:46 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 31 May 2010 00:46:41 +0000 (20:46 -0400)
ansel/lib/Faces/Facedetect.php [new file with mode: 0644]
ansel/lib/Faces/User.php [new file with mode: 0644]
ansel/lib/Faces/facedetect.php [deleted file]
ansel/lib/Faces/user.php [deleted file]

diff --git a/ansel/lib/Faces/Facedetect.php b/ansel/lib/Faces/Facedetect.php
new file mode 100644 (file)
index 0000000..ec69751
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Face_detect implementation
+ *
+ * @author  Duck <duck@obala.net>
+ * @package Ansel
+ */
+class Ansel_Faces_Facedetect extends Ansel_Faces_Base
+{
+    /**
+     * Where the face defintions are stored
+     */
+    private $_defs = '';
+
+    /**
+     * Create instance
+     */
+    public function __construct($params)
+    {
+        $this->_defs = $params['defs'];
+    }
+
+    /**
+     *
+     */
+    public function canAutogenerate()
+    {
+        return true;
+    }
+
+    /**
+     * Get faces
+     *
+     * @param string $file Picture filename
+     * @throws Horde_Exception
+     */
+    protected function _getFaces($file)
+    {
+        if (!Horde_Util::loadExtension('facedetect')) {
+            throw new Horde_Exception('You do not have the facedetect extension enabled in PHP');
+        }
+
+        return face_detect($file, $this->_defs);
+    }
+
+    /**
+     * Check if a face in is inside anoter face
+     *
+     * @param array $face  Face we are cheking
+     * @param array $faces Existing faces
+     *
+     * @param int Face ID containg passed face
+     */
+    protected function _isInFace($face, $faces)
+    {
+        foreach ($faces as $id => $rect) {
+            if ($face['x'] > $rect['x'] && $face['x'] + $face['w'] < $face['x'] + $rect['w']
+                && $face['y'] > $rect['y'] && $face['y'] + $face['h'] < $face['y'] + $rect['h']) {
+                return $id;
+            }
+        }
+
+        return false;
+    }
+
+    protected function _getParamsArray($face_id, $image, $rect)
+    {
+        return array($face_id,
+                     $image->id,
+                     $image->gallery,
+                     $rect['x'],
+                     $rect['y'],
+                     $rect['x'] + $rect['w'],
+                     $rect['y'] + $rect['h']);
+    }
+
+    protected function _createView($face_id, $image, $rect)
+    {
+        return $this->createView($face_id,
+                                $image,
+                                $rect['x'],
+                                $rect['y'],
+                                $rect['x'] + $rect['w'],
+                                $rect['y'] + $rect['h']);
+    }
+
+}
diff --git a/ansel/lib/Faces/User.php b/ansel/lib/Faces/User.php
new file mode 100644 (file)
index 0000000..ff6f0d2
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+/**
+ * @author  Duck <duck@obala.net>
+ * @package Ansel
+ */
+class Ansel_Faces_User extends Ansel_Faces_Base
+{
+}
diff --git a/ansel/lib/Faces/facedetect.php b/ansel/lib/Faces/facedetect.php
deleted file mode 100644 (file)
index ec69751..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-/**
- * Face_detect implementation
- *
- * @author  Duck <duck@obala.net>
- * @package Ansel
- */
-class Ansel_Faces_Facedetect extends Ansel_Faces_Base
-{
-    /**
-     * Where the face defintions are stored
-     */
-    private $_defs = '';
-
-    /**
-     * Create instance
-     */
-    public function __construct($params)
-    {
-        $this->_defs = $params['defs'];
-    }
-
-    /**
-     *
-     */
-    public function canAutogenerate()
-    {
-        return true;
-    }
-
-    /**
-     * Get faces
-     *
-     * @param string $file Picture filename
-     * @throws Horde_Exception
-     */
-    protected function _getFaces($file)
-    {
-        if (!Horde_Util::loadExtension('facedetect')) {
-            throw new Horde_Exception('You do not have the facedetect extension enabled in PHP');
-        }
-
-        return face_detect($file, $this->_defs);
-    }
-
-    /**
-     * Check if a face in is inside anoter face
-     *
-     * @param array $face  Face we are cheking
-     * @param array $faces Existing faces
-     *
-     * @param int Face ID containg passed face
-     */
-    protected function _isInFace($face, $faces)
-    {
-        foreach ($faces as $id => $rect) {
-            if ($face['x'] > $rect['x'] && $face['x'] + $face['w'] < $face['x'] + $rect['w']
-                && $face['y'] > $rect['y'] && $face['y'] + $face['h'] < $face['y'] + $rect['h']) {
-                return $id;
-            }
-        }
-
-        return false;
-    }
-
-    protected function _getParamsArray($face_id, $image, $rect)
-    {
-        return array($face_id,
-                     $image->id,
-                     $image->gallery,
-                     $rect['x'],
-                     $rect['y'],
-                     $rect['x'] + $rect['w'],
-                     $rect['y'] + $rect['h']);
-    }
-
-    protected function _createView($face_id, $image, $rect)
-    {
-        return $this->createView($face_id,
-                                $image,
-                                $rect['x'],
-                                $rect['y'],
-                                $rect['x'] + $rect['w'],
-                                $rect['y'] + $rect['h']);
-    }
-
-}
diff --git a/ansel/lib/Faces/user.php b/ansel/lib/Faces/user.php
deleted file mode 100644 (file)
index ff6f0d2..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-/**
- * @author  Duck <duck@obala.net>
- * @package Ansel
- */
-class Ansel_Faces_User extends Ansel_Faces_Base
-{
-}