Image Processing lets you resize an image by specifying a target width and height. You can also specify only the width or height, and the image is scaled proportionally based on its longer or shorter edge.
Parameters
Name | Description | Valid values |
w | The width of the target thumbnail. | 1 to 4096 |
h | The height of the target thumbnail. | 1 to 4096 |
e | The preferred edge for scaling. Note During scaling, the aspect ratio of the source image may differ from the aspect ratio of the target dimensions. You must specify whether to scale based on the longer or shorter edge. For example, a 200 × 400 image (1:2 ratio) needs to be scaled to 100 × 100 (1:1 ratio). If you scale based on the longer edge (e=0), the image is resized to 50 × 100. If you scale based on the shorter edge (e=1), the image is resized to 100 × 200. If you do not specify this parameter, the longer edge is used by default. |
|
l | Specifies whether to process the image if the target thumbnail is larger than the source image. |
|
Notes
The product of the thumbnail's width and height cannot exceed 4096 × 4096. The length of a single edge cannot exceed 4096 × 4.
If you do not specify a format, the source image is converted to JPG by default. However, if the source image is in the PNG, WebP, or BMP format, this default conversion may cause image distortion. For more information, see Quality transformations and Format conversions.
Examples
Scale the image to a width of 100 and a height of 100 based on the longer edge.
https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg@100h_100w_0e

Scale the image to a width of 100 and a height of 100 based on the shorter edge.
https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg@100h_100w_1e
