You can resize images by percentage, by condition, adaptively, or to a specific size. This is useful when a platform or application requires specific image dimensions, such as for profile pictures or thumbnails.
Parameters
image_process=resize
The following table lists the supported parameters.
-
If any parameter is set to a negative value, the original image is returned without processing.
-
Only downsizing is supported. If the specified dimensions exceed the original size, the original image is returned.
|
Parameter |
Description |
Value range |
|
w |
The target width of the image. |
Default value: 0. The total pixel count of the image cannot exceed 16,777,216. |
|
h |
The target height of the image. |
|
|
l |
The target length of the longer side of the image. |
|
|
s |
The target length of the shorter side of the image. |
|
|
fw and fh |
The target width and height of the image. |
|
|
p |
The percentage by which the image is proportionally resized. |
[0,100] |
Examples
The following table provides image resizing examples.
|
Method |
Operation |
Example |
|
Based on a specific aspect ratio |
Resize an image proportionally. |
|
|
Based on conditions |
Resize an image only if the file size is at least 1,024,000 bytes. Note: The threshold of 1,024,000 in this example is customizable based on your requirements. |
|
|
Based on the longer side |
Resize an image by specifying the longer side length. |
|
|
Based on the shorter side |
Resize an image by specifying the shorter side length. |
|
|
Based on the width |
Resize an image by specifying the width. |
|
|
Based on the height |
Resize an image by specifying the height. |
|
|
Based on the specified height and width |
Resize an image by specifying both the width and height. |
|