本文整理匯總了PHP中ImageManager::resizeScale方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageManager::resizeScale方法的具體用法?PHP ImageManager::resizeScale怎麽用?PHP ImageManager::resizeScale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImageManager
的用法示例。
在下文中一共展示了ImageManager::resizeScale方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: editProfile
private function editProfile()
{
if ($this->registry->getObject('authenticate')->isLoggedIn() == true) {
$user = $this->registry->getObject('authenticate')->getUser()->getUserID();
if (isset($_POST) && count($_POST) > 0) {
$profile = new ProfileModel($this->registry, $user);
$profile->setBio($this->registry->getObject('db')->sanitizeData($_POST['bio']));
$profile->setName($this->registry->getObject('db')->sanitizeData($_POST['name']));
$profile->setGender($this->registry->getObject('db')->sanitizeData($_POST['gender']), false);
$profile->setDOB($this->registry->getObject('db')->sanitizeData($_POST['dob']), false);
if (isset($_FILES['profile_pic'])) {
require_once 'mediaManager.php';
$im = new ImageManager();
$image = $im->loadFromPost('profile_pic', $this->registry->getSetting('upload_path') . 'profile/' . $profile->getUsername() . '/', time());
//$images .= $image;
if ($image == true) {
$im->resizeScale(50);
$im->save($this->registry->getSetting('upload_path') . 'profile/' . $im->getName());
$profile->setPhoto($im->getName());
}
//$this->registry->redirectUser('profile/edit/'.$profile->getID(), 'Image Saved', 'Image upload success');
} else {
$this->registry->errorPage('Error', 'Image uploading failed');
}
$profile->save();
$this->registry->redirectUser('profile/view', 'Profile saved', 'The changes to your profile have been saved.');
//array('profile', 'view', 'edit')
} else {
//Show the edit form
$this->registry->getObject('template')->buildFromTemplate('header.php', 'profile_info_edit.php', 'footer.php');
$profile = new ProfileModel($this->registry, $user);
$profile->toTags('p_');
}
} else {
$this->registry->errorPage('Error', 'Please login to continue');
}
}