本文整理汇总了PHP中image::create_img方法的典型用法代码示例。如果您正苦于以下问题:PHP image::create_img方法的具体用法?PHP image::create_img怎么用?PHP image::create_img使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image
的用法示例。
在下文中一共展示了image::create_img方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: strrchr
$ext = strrchr($_FILES["photo"]['name'][$key], ".");
$ran_num = (time() | 0) . "_" . rand(0, 999999999);
$output_path = "../../gallery_activity/";
$file_name = $id . "_{$ran_num}.png";
$ori_file_name = $id . "_{$ran_num}{$ext}";
// $size = GetImageSize($upfile);
// copy($upfile,$output_path.$file_name);
// image_resize( $upfile, $output_filename, $output_path, 190, 120);
// // copy($upfile,$output_path."small/".$file_name);
// image_resize( $upfile, $output_filename, $output_path, 90, 60);
// copy( $upfile, $output_path."original/".$ori_file_name );
$image = (require_once "../../include/image.class.php");
$image = new image();
$image->source = $_FILES['photo']["tmp_name"][$key];
$image->allow_size = 5;
$image->save_path = "../../gallery_activity/";
$image->save_name = $ori_file_name;
if ($image->upload()) {
// mysql_query("INSERT INTO tbl_file_attachment (`file_id`, `url`) value({$last_insert_id}, '{$filename}');");
$image->create_img(190, 120, 0, NULL, "web");
$image->create_img(90, 60, 0, NULL, "thumb");
}
$sql_c = "INSERT INTO `tbl_activity_gallery` ( `act_id`, `file_name`, `ori_file_name`, `remark`, `g_order` ) VALUES ('{$id}', '{$ori_file_name}', '{$ori_file_name}', '{$remark}', {$g_order} )";
mysql_query("set names utf8");
mysql_query($sql_c, $link_id);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
/* End Upload Photo */
//////////////////////////////////////////////////////////////////////////////////////////////////////
mysql_close();
示例2: basename
if (is_uploaded_file($_FILES["n_photo"]['tmp_name'])) {
$uploadfilename = basename($_FILES['n_photo']['name']);
$suffix = explode('.', $uploadfilename);
$suffix = $suffix[count($suffix) - 1];
if (in_array($suffix, array("php", "php3"))) {
exit("<script>alert('Disallow file type.');history.back(-1);</script>");
}
$filename = "p" . $last_insert_id . "_" . date("YmdHis") . rand(10000, 99999) . '.' . $suffix;
require_once '../../include/image.class.php';
$image = new image();
$image->source = $_FILES['n_photo']["tmp_name"];
$image->allow_size = 5;
$image->save_path = "../../file_download/";
$image->save_name = $filename;
if ($image->upload()) {
$image->create_img(222, 148, 0, NULL, "thumb");
$query = "UPDATE `tbl_chancellor` SET file_photo='{$filename}' WHERE file_id={$last_insert_id} ";
mysql_query($query);
} else {
print_r($image->err_log);
exit;
}
}
$filename = $_FILES["n_file"]['name'];
$new_filename = $last_insert_id . "_" . (time() | 0) . substr($filename, -4);
if (isset($_FILES["n_file"]["tmp_name"]) && $_FILES["n_file"]["tmp_name"] != "") {
if (!copy($_FILES["n_file"]["tmp_name"], "../../file_download/" . $new_filename)) {
echo "Fail to copy doc file - " . $_FILES["n_file"]["tmp_name"];
exit;
} else {
$query = "UPDATE `tbl_chancellor` SET file_file_name='{$new_filename}' WHERE file_id={$last_insert_id} ";