本文整理汇总了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);
}