public function getFromGallery($gallery_id, $create = false, $force = false)
{
$gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($gallery_id);
if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied(_("Access denied editing this gallery."));
}
$images = $gallery->getImages();
$faces = array();
foreach ($images as $image) {
if ($image->facesCount && $force == false) {
continue;
}
$result = $this->getFromPicture($image, $create);
if (!empty($result)) {
$faces[$image->id] = $result;
}
unset($image);
}
return $faces;
}