tencentyun/image-nodejs-sdk
腾讯云 万象优图(Cloud Image) SDK for Node.js
安装
npm install tencentyun-ci --save
动态指定您的配置
tencentyunconf;
运行测试程序
修改sample/samplev2.js
文件中的配置参数,否则提示错误信息智能鉴黄imageprocess.pornDetect { code: 11, message: 'secretid not exist', data: {} }
npm install && npm start
V2版本空间和自定义文件名的上传,查询和删除示例
var tencentyun = ; // 自定义空间名称,在http://console.qcloud.com/ci/bucket创建var bucket = 'bucket'; // 前三个参数在https://console.qcloud.com/ci/secret查看,bucket在https://console.qcloud.com/ci/bucket 查看tencentyunconf; //智能鉴黄var pornUrl = 'http://b.hiphotos.baidu.com/image/pic/item/8ad4b31c8701a18b1efd50a89a2f07082938fec7.jpg';tencentyunimageprocess; //智能鉴黄-Urlvar pornUrl = 'http://b.hiphotos.baidu.com/image/pic/item/8ad4b31c8701a18b1efd50a89a2f07082938fec7.jpg' 'http://c.hiphotos.baidu.com/image/h%3D200/sign=7b991b465eee3d6d3dc680cb73176d41/96dda144ad3459829813ed730bf431adcaef84b1.jpg' ;tencentyunimageprocess; //智能鉴黄-Filevar pornFile = 'D:/porn/test1.jpg' 'D:/porn/test2.jpg' '../../../../../porn/test3.png' ;tencentyunimageprocess; // 自定义文件名var fileid = 'sample' + ; tencentyunimagev2;
图片和微视频上传、查询、删除程序示例
var tencentyun = ; tencentyunconf; tencentyunimage; // 带自定义信息的上传tencentyunvideo;