Ansel_Faces_Base::getImageFacesData PHP Method

getImageFacesData() public method

Used if we need to build the face image at some point after it is detected.
public getImageFacesData ( integer $image_id, boolean $full = false ) : array
$image_id integer The image_id of the Ansel_Image these faces are for.
$full boolean Get full face data or just face_id and face_name.
return array An array of faces data.
    public function getImageFacesData($image_id, $full = false)
    {
        $sql = 'SELECT face_id, face_name, image_id';
        if ($full) {
            $sql .= ', gallery_id, face_x1, face_y1, face_x2, face_y2';
        }
        $sql .= ' FROM ansel_faces WHERE image_id = ' . (int) $image_id . ' ORDER BY face_id DESC';
        try {
            return $GLOBALS['ansel_db']->selectAll($sql);
        } catch (Horde_Db_Exception $e) {
            throw new Ansel_Exception($e);
        }
    }