GET /<ObjectKey>?imageMogr2/cut/<width>x<height>x<dx>x<dy>/crop/<imageSizeAndOffsetGeometry>/iradius/<radius>/rradius/<radius>/scrop/<Width>x<Height> 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/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 |
ObjectKey | Object name, such as folder/sample.jpg . |
/ignore-error/1 | If this parameter is carried and the image fails to be processed because the image is too large or a parameter value exceeds the limit, 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 top-left vertex |
<dy> | Vertical offset relative to the top-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> | Crops to a circle. radius specifies the radius of the inscribed circle, which should be an integer greater than zero and less than half of the shorter side of the input image. The center of the inscribed circle is the center of the image. This operation is not supported for GIF images. |
Parameter | Description |
/rradius/<radius> | Crops with round corners. radius specifies the radius of the rounded corner of the image, which should be an integer greater than zero and less than half of the shorter side of the input image. The two sides of the image are the tangent lines of the rounded corner. This operation is not supported for GIF images. |
Parameter | Description |
/scrop/<Width>x<Height> | Scales and crops an image based on the face position in the image. The width and height of the target image are specified by Width and Height respectively. |
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
Was this page helpful?