คือ เดิมที่ผมทำงานเรียก แบบ
โค้ด: เลือกทั้งหมด
$filename = 'Untitled_Diagram.jpg'; //ไฟล์ที่ใช้งาน
$foo = new \upload($filename); // ส่วนนี้ไว้ใช้ส่งไฟล์รูปภาพไๆปสั่งฟังชั่น
if ($foo->uploaded) { //ตรวจสอบมีการส่งค่าไปฟังชั่นหรือไม
$foo->image_watermark = $filename;
$foo->image_text = 'test'; //ใส่ตัวอักษร
$foo->image_watermark_position = 'R';
$foo->image_text_color = '#000000';
$foo->image_text_opacity = 80;
$foo->image_text_background_opacity = 70;
$foo->image_resize = true;
$foo->image_ratio_pixels = 960000;
$foo->image_text_padding = 20;
$foo->file_new_name_body = 'piece';
$foo->process('/opt/lampp/htdocs/test/'); //โล์เดอร์ที่จัดเก็บ
if ($foo->processed) {
echo "เสร็จสิน";
} else {
echo 'error : ' . $foo->error;
}
}