本文整理汇总了PHP中Ansel::getImageFromFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Ansel::getImageFromFile方法的具体用法?PHP Ansel::getImageFromFile怎么用?PHP Ansel::getImageFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ansel
的用法示例。
在下文中一共展示了Ansel::getImageFromFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _
if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$error = _("Access denied adding photos to this gallery.");
} else {
$error = false;
}
} catch (Ansel_Exception $e) {
$error = _("There was an error accessing the gallery.");
}
}
if (!$name || $error) {
$error = _("No file specified");
} else {
try {
$GLOBALS['browser']->wasFileUploaded('imagefile', _("photo"));
try {
$image = Ansel::getImageFromFile($file, array('image_filename' => $name));
} catch (Ansel_Exception $e) {
$error = $e->getMessage();
}
$gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($galleryId);
try {
$image_id = $gallery->addImage($image);
$error = false;
} catch (Ansel_Exception $e) {
$error = _("There was a problem uploading the photo.");
}
} catch (Horde_Browser_Exception $e) {
$error = $e->getMessage();
}
}
if ($error) {