 |
|
นี่คือโค้ดภาพตัวแรกครับ (โลโก้)
$photo1=$_FILES['image_machine']['tmp_name'];
$photo1_name=$_FILES['image_machine']['name'];
$photo1_size=$_FILES['image_machine']['size'];
$photo1_type=$_FILES['image_machine']['type'];
$random_txt=random_password(7);
$original_name=strstr($photo1_name,'.');
$now=date("Dgis");
$image_machine="$now$random_txt$original_name";
$width_require_ss=$width_prd_ss;
$height_require_ss=$height_prd_ss;
$width_require_s=$width_prd_s;
$height_require_s=$height_prd_s;
$width_require_m=$width_prd_m;
$height_require_m=$height_prd_m;
$directory_ss=$dir_prd_ss.basename($image_machine);
$directory_s=$dir_prd_s.basename($image_machine);
$directory_m=$dir_prd_m.basename($image_machine);
$directory_l=$dir_prd_l.basename($image_machine);
// เริ่มลดขนาดรูปภาพ
$dimension=calculate_size($photo1,$width_require_ss,$height_require_ss);
$export_image=resize_image($photo1,$directory_ss,$file_quality,$photo1_type,$dimension,$file_txt_image);
$dimension=calculate_size($photo1,$width_require_s,$height_require_s);
$export_image=resize_image($photo1,$directory_s,$file_quality,$photo1_type,$dimension,$file_txt_image);
$dimension=calculate_size($photo1,$width_require_m,$width_require_m);
$export_image=resize_image($photo1,$directory_m,$file_quality,$photo1_type,$dimension,$file_txt_image);
$export_image=resize_image($photo1,$directory_l,$file_quality,$photo1_type,0,$file_txt_image);
@unlink($photo1);
ส่วนตัวที่สองผมก็ทำเหมือนกันแต่กำหนดตัวแปรคนละชื่อ แต่ค่าที่ได้มันจะเก็บเอาค่าแรกที่เรา browse มานั่นคือค่าของโลโกครับ
|
 |
 |
 |
 |
Date :
2010-09-21 14:40:33 |
By :
sakdalll |
|
 |
 |
 |
 |
|
|
 |