当前位置: 首页>>代码示例>>PHP>>正文


PHP Images::cropImage方法代码示例

本文整理汇总了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);
开发者ID:abdulnizam,项目名称:php-freniz,代码行数:31,代码来源:setassecpic.php

示例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;
 }
开发者ID:tiger154,项目名称:prototype,代码行数:20,代码来源:Profile.php


注:本文中的Images::cropImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。