作者 lyh

gx脚本demo

... ... @@ -327,6 +327,6 @@ class LoginController extends BaseController
public function ceshi(){
$cos = new CosService();
return $cos->addFieldImage('https://ecdn6.globalso.com/upload/p/2000/image_product/2024-07/aero-y50-introduction-3.jpg',['characters'=>'这是水印'],false);
return $cos->addFieldImage('https://ecdn6.globalso.com/upload/p/2000/image_product/2024-07/aero-y50-introduction-3.jpg',['image'=>'https://ecdn6.globalso.com/upload/p/2000/image_product/2024-07/aero-y50-introduction-3.jpg'],true);
}
}
... ...
... ... @@ -183,10 +183,10 @@ class CosService
$param = [
'text/'.urlencode(base64_encode("{$data['characters']}")),//文字水印名称
$data['position'] ?? 'gravity/SouthEast',
// $data['dx'] ?? 'dx/10/dy/10',
// $data['font'] ?? 'font/5bCP6aOe',//默认宋体
// $data['fontsize'] ?? 'fontsize/24',//大小
// $data['fill'] ?? 'fill/I0ZGRkZGRg==',//颜色
$data['dx'] ?? 'dx/10/dy/10',
$data['font'] ?? 'font/5bCP6aOe',//默认宋体
$data['fontsize'] ?? 'fontsize/24',//大小
$data['fill'] ?? 'fill/I0ZGRkZGRg==',//颜色
];
$cdnUrl = $cdnUrl.'?imageMogr2/watermark/3/'.implode('/',$param);
}
... ...