History
Introduction
API Category
Making API Requests
Region APIs
Instance APIs
Cloud Hosting Cluster APIs
Image APIs
Instance Launch Template APIs
Placement Group APIs
Key APIs
Security Group APIs
Network APIs
Data Types
Error Codes
cos:GetObject。cos:PutObject。cos:PutObject。GET /<ObjectKey>?imageMogr2/indexcrop/width/<width>/height/<height>/index/<index> 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": "imageMogr2/indexcrop/width/<width>/height/<height>/index/<index>"}]}
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": "imageMogr2/indexcrop/width/<width>/height/<height>/index/<index>"}]}
fileid 与 ObjectKey 相同时,处理后的图片将覆盖原图存储;不相同时将分别存储原图和处理后图片。fileid 的值需要经过 URL 安全的 Base64编码。参数 | 含义 | 类型 | 是否必选 |
ObjectKey | 对象文件名,例如 folder/sample.jpg。 | String | 是 |
indexcrop/width/<width> | 指定在水平方向切割出的每块区域的长度,值为像素,取值范围:大于0且不超过图片宽度的正整数。 注:<width>参数与<height>参数只能任选其一。 | Int | 是 |
indexcrop/height/<height> | 指定在竖直方向切割出的每块区域的长度,值为像素,取值范围:大于0且不超过图片高度的正整数。 注:<width>参数与<height>参数只能任选其一。 | Int | 是 |
indexcrop/index/<index> | 被切割后的图片区域索引值,默认值为0,表示取第一块。 | Int | 否 |
/ignore-error/1 | 当处理参数中携带此参数时,针对文件过大、参数超限等导致处理失败的场景,会直接返回原图而不报错。 | String | 否 |
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg

https://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/indexcrop/width/100/index/0

http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/indexcrop/width/100/|imageMogr2/indexcrop/height/100/index/1/

http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?q-sign-algorithm=<signature>&imageMogr2/indexcrop/width/100/index/0
文档反馈