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/cgif/<FrameNumber>/egif/<FrameInterval> 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/cgif/<FrameNumber>/egif/<FrameInterval>"}]}
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/cgif/<FrameNumber>/egif/<FrameInterval>"}]}
fileid is the same as ObjectKey, the processed image will overwrite the original image storage; if they are different, both the original image and the processed image will be stored separately.fileid needs to be passed through URL-safe Base64 encoding.Parameter | Meaning | Type | Required |
ObjectKey | Object filename, for example folder/sample.gif. | String | Yes |
/frame/ | Extract a single frame from a GIF (processing during download only): You can specify to extract the Nth frame of the GIF, where N is a positive integer (1, 2, 3...). If N exceeds the maximum frame number of the GIF, the last frame will be taken. For example, to extract the 1st frame of a GIF, the parameter is /frame/1. | Int | No |
/cgif/ | GIF format optimization (frame extraction type): Optimized for original images in GIF or WebP format, this optimization involves extracting frames and reducing image colors. It is divided into the following two scenarios: If FrameNumber = 1, the default frame count of 30 is used. If the image frame number is larger than this, frames will be extracted to reduce to 30. If FrameNumber is in the range (1,100], the image will be compressed to the specified number of frames (FrameNumber). | String | No |
/egif/ | GIF format optimization (frame sampling type): Optimized for original images in GIF or WebP format, this optimization involves reducing image colors and extracting target frames at a certain frame interval (FrameInterval) for output. FrameInterval takes values in the range [1,10]. | String | 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-125xxxxxx.cos.ap-shanghai.myqcloud.com/sample.gif?imageMogr2/cgif/10
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?q-sign-algorithm=sha1&q-ak=**********************************&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=**************************************&watermark/1/image/aHR0cDovL2V4YW1wbGVzLTEyNTEwMDAwMDQucGljc2gubXlxY2xvdWQuY29tL3NodWl5aW4uanBn/gravity/southeast
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan