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 in the authorization policy.cos:PutObject in the authorization policy.cos:PutObject in the authorization policy.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 is the same as ObjectKey, the processed file will overwrite the original file storage; if they are different, the original file and the processed file will be stored separately.fileid needs to be passed through URL-safe Base64 encoding.Parameter | Description | Type | Required |
ObjectKey | Object filename, for example folder/sample.jpg. | String | Yes |
indexcrop/width/<width> | Specify the length of each area divided by horizontal cuts, in pixels. The value must be a positive integer greater than 0 and not exceeding the image width. Note: You may only use either the <width> or <height> parameter. | Int | Yes |
indexcrop/height/<height> | Specify the length of each area divided by vertical cuts, in pixels. The value must be a positive integer greater than 0 and not exceeding the image height. Note: You may only use either the <width> or <height> parameter. | Int | Yes |
indexcrop/index/<index> | Index value of the image area, default value is 0, which means taking the first block. | Int | No |
/ignore-error/1 | When processing requests carry this parameter, if operations fail due to oversized files or parameter exceeds limit, it will directly return the original image without reporting an error. | String | No |
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
フィードバック