GET /<ObjectKey>?watermark/2/text/<encodedText>/font/<encodedFont>/fontsize/<fontSize>/fill/<encodedColor>/dissolve/<dissolve>/gravity/<gravity>/dx/<dx>/dy/<dy>/batch/<type>/degree/<degree>/shadow/<shadow> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringPic-Operations:{"is_pic_info": 1,"rules": [{"fileid": "exampleobject","rule": "watermark/2/text/<encodedText>/font/<encodedFont>/fontsize/<fontSize>/fill/<encodedColor>/dissolve/<dissolve>/gravity/<gravity>/dx/<dx>/dy/<dy>/batch/<type>/degree/<degree>/shadow/<shadow>"}]}
POST /<ObjectKey>?image_process HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-length: SizeAuthorization: Auth StringPic-Operations:{"is_pic_info": 1,"rules": [{"fileid": "exampleobject","rule": "watermark/2/text/<encodedText>/font/<encodedFont>/fontsize/<fontSize>/fill/<encodedColor>/dissolve/<dissolve>/gravity/<gravity>/dx/<dx>/dy/<dy>/batch/<type>/degree/<degree>/shadow/<shadow>"}]}
参数 | 含义 |
ObjectKey | 对象文件名,例如 folder/sample.jpg。 |
/text/ | 水印内容,需要经过 URL 安全的 Base64 编码 |
/font/ | |
/fontsize/ | |
/fill/ | |
/dissolve/ | 文字透明度,取值1 - 100,默认90(90%不透明度) |
/gravity/ | |
/dx/ | 水平(横轴)边距,单位为像素,缺省值为0 |
/dy/ | 垂直(纵轴)边距,单位为像素,默认值为0 |
/batch/ | 平铺水印功能,可将文字水印平铺至整张图片。值为1时,表示开启平铺水印功能 |
/spacing/ | 平铺模式下的水平、垂直间距相对文字水印贴图的宽高百分比,范围为[0,100],默认10 |
/degree/ | 当 batch 值为1时生效。文字水印的旋转角度设置,取值范围为0 - 360,默认0 |
/shadow/ | 文字阴影效果,有效值为[0,100],默认为0,表示无阴影 |
/scatype/ | 根据原图的大小,缩放调整文字水印的大小: 当 scatype 设置为1时,按原图的宽缩放 当 scatype 设置为2时,按原图的高缩放 当 scatype 设置为3时,按原图的整体面积缩放 |
/spcent/ | 与 scatype 搭配使用: 当 scatype 设置为1时,该有效值为[1, 1000],单位为千分比 当 scatype 设置为2时,该有效值为[1, 1000],单位为千分比 当 scatype 设置为3时,该有效值为[1, 250],单位为千分比。 |
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?watermark/2/text/6IW-6K6v5LqRwrfkuIfosaHkvJjlm74/fill/IzNEM0QzRA/fontsize/20/dissolve/50/gravity/northeast/dx/20/dy/20/batch/1/degree/45
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?q-sign-algorithm=<signature>&watermark/2/text/6IW-6K6v5LqRwrfkuIfosaHkvJjlm74/fill/IzNEM0QzRA/fontsize/20/dissolve/50/gravity/northeast/dx/20/dy/20/batch/1/degree/45
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?q-sign-algorithm=sha1&q-ak=AKID********************&q-sign-time=1593342360;1593342720&q-key-time=1593342360;1593342720&q-header-list=&q-url-param-list=watermark%252f1%252fimage%252fahr0cdovl2v4yw1wbgvzlteyntewmdawmdqucgljc2gubxlxy2xvdwquy29tl3nodwl5aw4uanbn%252fgravity%252fsoutheast&q-signature=26a429871963375c88081ef60247c5746e834a98&watermark/1/image/aHR0cDovL2V4YW1wbGVzLTEyNTEwMDAwMDQucGljc2gubXlxY2xvdWQuY29tL3NodWl5aW4uanBn/gravity/southeast
本页内容是否解决了您的问题?