本文整理匯總了PHP中Media_Model::cropImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Media_Model::cropImage方法的具體用法?PHP Media_Model::cropImage怎麽用?PHP Media_Model::cropImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Media_Model
的用法示例。
在下文中一共展示了Media_Model::cropImage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
if ($newData) {
if ($_POST['lastIdLogo'] > 0) {
if ($model->updateCompanyLogo($_POST['lastIdLogo'], $result['fileName'])) {
$lastId = $_POST['lastIdLogo'];
}
} else {
$lastId = $model->addCompanyLogo($_POST['companyId'], $result['fileName']);
}
}
$data = array('success' => true, 'fileName' => $result['fileName'], 'wp' => $wp, 'hp' => $hp, 'lastId' => $lastId);
echo htmlspecialchars(json_encode($data), ENT_NOQUOTES);
}
break;
// Crop
// Crop
case 2:
$model = new Media_Model();
$data = $backend->loadBackend();
if (!empty($_POST)) {
$dstWidth = 300;
$dstImageHeight = 150;
$source = $root . '/img-up/companies_pictures/original/' . $_POST['imgId'];
$destination = $root . '/img-up/companies_pictures/logo/' . $_POST['imgId'];
if ($model->cropImage($_POST, $dstWidth, $dstImageHeight, $source, $destination)) {
echo '1';
} else {
echo '0';
}
}
break;
}
示例2: array
}
$data = array('success' => true, 'fileName' => $result['fileName'], 'wp' => $wp, 'hp' => $hp, 'lastId' => $lastId);
echo htmlspecialchars(json_encode($data), ENT_NOQUOTES);
}
break;
// Crop
// Crop
case 2:
$model = new Media_Model();
$data = $backend->loadBackend();
if (!empty($_POST)) {
$dstWidth = 1070;
$dstImageHeight = 370;
$source = $root . 'img-up/main-gallery/original/' . $_POST['imgId'];
$destination = $root . 'img-up/main-gallery/front/' . $_POST['imgId'];
if ($model->cropImage($_POST, $dstWidth, $dstImageHeight, $source, $destination)) {
if ($model->cropImage($model->getThumb($_POST['imgId'], $root . 'img-up/main-gallery/front/', $root . 'img-up/main-gallery/thumb/', 200, 'width', ''))) {
echo '1';
} else {
echo '0';
}
}
}
break;
// Update
// Update
case 3:
$model = new Layout_Model();
if (!empty($_POST)) {
$model->editSliderInfo($_POST);
}