Resize an image by specifying the width and height

更新时间:
复制 MD 格式

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.

  • 0 (default): Scales based on the longer edge.

  • 1: Scales based on the shorter edge.

l

Specifies whether to process the image if the target thumbnail is larger than the source image.

  • 0 (default): Processes the image.

  • 1: No action is taken.

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