本文整理汇总了PHP中SimpleImage::cropTo方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleImage::cropTo方法的具体用法?PHP SimpleImage::cropTo怎么用?PHP SimpleImage::cropTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleImage
的用法示例。
在下文中一共展示了SimpleImage::cropTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SimpleImage
$timg['File_Type_ID'] = array_search($ext, $allow);
$timg['User_ID'] = $_SESSION['user_id'];
$timg['Original_File'] = $_FILES['uploadedfile']['name'][$u];
$insert = $db->insert("Files", $timg);
$fileid = $insertid;
$target_file = $target_path . $fileid . ".{$ext}";
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'][$u], $target_file)) {
$error .= "<br>The file has been uploaded</p>";
} else {
$error .= "<br>There was an error uploading the file, please try again!";
$delete = $db->delete("Files", "File_ID=" . $fileid);
}
if (in_array($ext, $img_array)) {
$image = new SimpleImage();
$image->load($target_file);
$image->cropTo(150);
$image->save($target_path . $fileid . '_sm.jpg');
}
} elseif ($_FILES['uploadedfile']['name'][$u] != "") {
$error .= "You must upload a " . implode(', ', $allow);
}
//echo $error;
}
}
}
}
if ($_POST['redirect']) {
if (strstr($_POST['redirect'], "tasks.php")) {
if (strstr($_POST['redirect'], "?")) {
$error = "&error=" . urlencode($error);
} else {