File tree Expand file tree Collapse file tree 2 files changed +230
-0
lines changed
Expand file tree Collapse file tree 2 files changed +230
-0
lines changed Original file line number Diff line number Diff line change 1313 'secretId ' => $ secretId ,
1414 'secretKey ' => $ secretKey )));
1515try {
16+ // 获取图片base64编码
17+ // $localImageFile = '/tmp/test.jpg';
18+ // $img = file_get_contents($localImageFile);
19+ // $imgInfo = getimagesize($localImageFile);
20+ // $imgBase64Content = base64_encode($img);
21+
1622 $ result = $ cosClient ->detectImages (array (
1723 'Bucket ' => 'examplebucket-125000000 ' , //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
1824 'Inputs ' => array (
2834// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
2935// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
3036 ),
37+ // array(
38+ // 'Content' => $imgBase64Content, // 图片文件的内容,需要先经过 base64 编码。
39+ //// 'Interval' => 5, // 可选 审核 GIF 时使用 截帧的间隔
40+ //// 'MaxFrames' => 5, // 可选 针对 GIF 动图审核的最大截帧数量,需大于0。
41+ //// 'DataId' => 'bbb', // 可选 图片标识,该字段在结果中返回原始内容,长度限制为512字节
42+ // ),
3143 ),
3244// 'Conf' => array(
3345// 'BizType' => '', // 可选 定制化策略,不传走默认策略
You can’t perform that action at this time.
0 commit comments