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