download_url?imageMogr2/cut/<width>x<height>x<dx>x<dy>/crop/<imageSizeAndOffsetGeometry>/iradius/<radius>/rradius/<radius>/scrop/<Width>x<Height>
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/cut/<width>x<height>x<dx>x<dy>/crop/<imageSizeAndOffsetGeometry>/iradius/<radius>/rradius/<radius>/scrop/<Width>x<Height>"}]}
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/cut/<width>x<height>x<dx>x<dy>/crop/<imageSizeAndOffsetGeometry>/iradius/<radius>/rradius/<radius>/scrop/<Width>x<Height>"}]}
Parameter | Description |
download_url | URL of the input image, formatted as <BucketName-APPID>.cos.<Region>.myqcloud.com/<picture name> Example: examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/picture.jpeg |
/ignore-error/1 | If this parameter is carried and the image failed to be processed because it is too large, the input image will be returned with no error reported. |
Parameter | Description |
<width> | Width of the output image |
<height> | Height of the output image |
<dx> | Horizontal offset relative to the upper-left vertex |
<dy> | Vertical offset relative to the upper-left vertex |
Parameter | Description |
/crop/<Width>x | Width of the output image with the height unchanged. The value must be greater than 0 and smaller than the width of the input image. |
/crop/x<Height> | Height of the output image with the width unchanged. The value must be greater than 0 and smaller than the height of the input image. |
/crop/<Width>x<Height> | Width and height of the output image. The values of width and height should be greater than 0 and smaller than those of the input image, respectively. |
gravity
parameter to specify the start position of the operation. For more information, see [Scaling and Cropping](#Scaling and cropping).Parameter | Description |
/iradius/<radius> | Refers to the inscribed circle cropping feature, where radius specifies the radius of the inscribed circle. The value of radius is an integer that is greater than 0 and less than half the length of the shorter side of the original image. The center of the inscribed circle is the center of the original image. This parameter is not supported if the image format is GIF. |
Parameter | Description |
/rradius/<radius> | Refers to the rounded corner cropping feature, where radius specifies the radius of the rounded corner of the image. The value of radius is an integer that is greater than 0 and less than half the length of the shorter side of the original image. The rounded corner is tangent to the edge of the original image. This parameter is not supported if the image format is GIF. |
Parameter | Description |
/scrop/<Width>x<Height> | Refers to scaling and cropping based on the location of the human face in the image. Width and Height respectively specify the width and the height of the target image. |
gravity
parameter for an operation, the corresponding red dot becomes the reference point, and offsets will be relative to this point.
gravity
is set to center
, dx
and dy
are invalid.gravity
is set to north
or south
, dx
is invalid.gravity
is set to west
or east
, dy
is invalid.http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/cut/600x600x100x10
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/crop/300x400/gravity/center
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/iradius/200
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/rradius/100
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/scrop/100x600
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?q-sign-algorithm=<signature>&imageMogr2/scrop/100x600
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
Apakah halaman ini membantu?