#上传原图 file_put_contents(IMG_PATH_BASE . $filePath, file_get_contents($_FILES['photo']['tmp_name'])); #修正图片大小 require_once 'lib/photo.class.php'; $photoTool = new photo(); $photoInfo = $photoTool->getPhotoInfo(IMG_PATH_BASE . $filePath); if ($photoInfo['width'] > 600) { $rate = $photoInfo['width'] / 600; $photoInfo['width'] = 600; $photoInfo['height'] = ceil($photoInfo['height'] / $rate); } #根据照片exif信息决定是否旋转 require_once 'lib/exif.php'; $exifInfo = GetImageInfo(IMG_PATH_BASE . $filePath); if ($exifInfo['方向'] == 'right side top') { $photoTool->flip(IMG_PATH_BASE . $filePath, IMG_PATH_BASE . $filePath, -90); $widthTmp = $photoInfo['width']; $photoInfo['width'] = $photoInfo['height']; $photoInfo['height'] = $widthTmp; } unset($exifInfo); $photoTool->copyImageWithSize(IMG_PATH_BASE . $filePath, IMG_PATH_BASE . $filePathSmall, $photoInfo['width'], $photoInfo['height']); } $param['accessToken'] = $_COOKIE['accessToken']; $param['event'] = $_POST['event']; $param['id'] = $_POST['id']; if (isset($filePathSmall) && $filePathSmall) { $param['photo'] = $filePathSmall; } FCurl::get('group/createEvent', $param); FCurl::header('group_info.php?id=' . $groupId);