This API imageMogr2 from Tencent Cloud CI is used to scale images in COS.
Image processing is a paid service, the fees of which are charged by Cloud Infinite. For detailed billing instructions, see Cloud Infinite’s [Billing and Pricing] (https://intl.cloud.tencent.com/document/product/1045/33431).
download_url?imageMogr2/thumbnail/<imageSizeAndOffsetGeometry>
Operation name: thumbnail.
Parameter | Description |
---|---|
download_url | URL that is used to access a file. Format: <BucketName-APPID>.cos.<picture region>.<domain>.com/<picture name> , for example, examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/picture.jpeg . |
/thumbnail/!<Scale>p | Specifies that the width and height of an image is Scale% of the original image. |
/thumbnail/!<Scale>px | Specifies that the width of an image is Scale% of the original image while the height keeps unchanged. |
/thumbnail/!x<Scale>p | Specifies that the height of the an image is Scale% of the original image while the width keeps unchanged. |
/thumbnail/<Width>x | Specifies the target image width, with the height proportionally scaled down. |
/thumbnail/x<Height> | Specifies the target image height, with the width proportionally scaled down. |
/thumbnail/<Width>x<Height> | Specifies the maximum width and height of a thumbnail for proportional scaling |
/thumbnail/!<Width>x<Height>r | Specifies the minimum width and height of a thumbnail for proportional scaling |
/thumbnail/<Width>x<Height> | Forces image scaling with the specified Width and Height, which may cause deformation of the target image |
/thumbnail/<Area>@ | Proportionally scales an image so that its total pixels does not exceed the value of Area |
Take the image below as an example:
This example shows you how to scale an image to 50% of its original width and height.
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/thumbnail/!50p
Final image:
This example shows you how to scale an image to 50% of its original width while keeping the height unchanged.
http://examples-1251000004.cos.ap-shanghai.myqcloud.com/sample.jpeg?imageMogr2/thumbnail/!50px
Final image:
Was this page helpful?