本文整理匯總了PHP中Images::cropImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Images::cropImage方法的具體用法?PHP Images::cropImage怎麽用?PHP Images::cropImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Images
的用法示例。
在下文中一共展示了Images::cropImage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Images
$ruserid;
$Imgs = new Images();
while ($row = mysql_fetch_assoc($result)) {
$url = $row['url'];
$albumid = $row['albumid'];
$pinnedpeople = unserialize($row['pinnedpeople']);
$suserid = $row['userid'];
$result1 = mysql_query("select userid from album where albumid='{$albumid}'");
while ($row1 = mysql_fetch_assoc($result1)) {
$ruserid = $row1['userid'];
}
}
if ($_SESSION['userdetails']['secondarypicalbum'] == $albumid) {
if ($_REQUEST['deletesrc'] == 'true') {
$resolutions = array(32, 50, 75, 200);
$Imgs->cropImage('../images/' . $url, '../images/' . $url, $resolutions, $_REQUEST['x'], $_REQUEST['y'], $_REQUEST['width'], $_REQUEST['height']);
}
if ($_REQUEST['secpicno'] == 1) {
mysql_query("update user_info set secondarypic1='" . $_REQUEST['imageid'] . "' where userid='" . $_SESSION['userid'] . "'");
} else {
mysql_query("update user_info set secondarypic2='" . $_REQUEST['imageid'] . "' where userid='" . $_SESSION['userid'] . "'");
}
//mysql_query("insert into image (title,description,url,albumid,userid,date,pinnedpeople,vote,pt,specificlist,hiddenlist,notifyusers,accepted,reqpinusers,pinmereq,comments) values('title','description','".$filename.'.'.$ext."','".$_REQUEST['album']."','".$_SESSION['userid']."',now(),'".$a."','".$a."','".$pt."','".$specific."','".$hidden."','a:0:{}','".$accepted."','a:0:{}','a:0:{}','a:0:{}')");
//$Imgs->setAsProPic($_REQUEST['imageid'],$_REQUEST['deletesrc'],$_REQUEST['x'],$_REQUEST['y'],$_REQUEST['width'],$_REQUEST['height']);
} else {
if ($_SESSION['userid'] == $suserid || $_SESSION['userid'] == $ruserid && in_array($pinnedpeople, $_SESSION['userid'])) {
$pathinfo = pathinfo($url);
$ext = $pathinfo['extension'];
$filename = md5(uniqid());
while (file_exists('../images/' . $filename . '.' . $ext)) {
$filename .= rand(10, 25);
示例2: updateHeaderImage
protected function updateHeaderImage()
{
$type = 'header';
$size = ['width' => 584, 'height' => 280];
$crop = [];
foreach (array('x', 'y', 'width', 'height', 'rotate', 'scaleX', 'scaleY') as $field) {
$crop[$field] = $_POST[$field];
}
$file = $_FILES['image'];
// crop 'n save
if ($img = Images::cropImage($file, self::$uid, $type, $size, $crop)) {
// wipe existing image(s)
static::removeHeaderImage();
// set new image
if (static::saveHeaderImage($img)) {
return $img;
}
}
return false;
}