This document describes how to use image processing in the COS Console with the following two methods. For more information, see Image Processing Overview.
- This image processing feature is only supported for Public Cloud regions in mainland China.
- 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.
To process an image object, you need the write permission for it. For object permissions setting, see Setting Object Access Permission.
Object URL?API name/operation name/processing parameters
If the image is private read, you need to add image processing parameters to a signed URL.
Example: scaling an image to 50% of its original size
Suppose that the original image is public read and private write in COS, with an object URL
Next, add the following parameters to the URL:
Now, you obtain a new URL
https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/sample.jpeg?imageMogr2/thumbnail/!50p. Paste this URL to you address bar, press Enter, and you will see a scaled image as shown below:
An image style is a template that combines real-time processing parameters for image download, and can be used to standardize image processing. The following example shows you how it works by using an image style of target width 480 px, and target height 270 px:
- Note that style names are case-sensitive and cannot be modified once saved.
- For the purpose of clarity, the separator you have enabled cannot be used in the style name.
- Up to 100 styles can be set for a single bucket.
- A new style takes effect in 30 minutes on average.
- Changing a separator requires clearing your cache, with the change taking effect across the entire network in at least 24 hours.
- Removing a separator already in use may make some features unable to work properly.
- For more information on image styles, see Setting Styles.
Now, you get a final object URL
Object URL + separator + style name
https://examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/sample.jpeg!yunstyle. Paste it to your address bar, press Enter, and you will see a scaled image as shown below: