0040-00000350

Updated at:

Problem description

The specified width or height exceeds the limit when you resize an image by fixing one edge or by proportional scaling. This error is specific to earlier versions of Image Service.

Problem cause

  • When you resize an image by fixing one edge, the dimension of the other edge is calculated based on the original image's aspect ratio. This error occurs if the calculated dimension exceeds the 16,384-pixel limit.

  • When you resize an image using proportional scaling, the output dimensions are calculated based on the original dimensions and the scaling percentage. This error occurs if the calculated width or height exceeds the 16,384-pixel limit.

Examples

In the following examples, the original resolution of the image example_image is 20000 × 40000 pixels:

GET /example_image@10000w.src HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 03 Feb 2023 03:41:49 GMT
Content-Type: application/xml

The preceding request resizes the original image by fixing one edge. The target width is 10,000 pixels. Because the original resolution is 20000 × 40000 pixels, the height of the output image is 40000 × (10000 ÷ 20000) = 20000 pixels. The output height exceeds the 16,384-pixel limit, which causes the error.

GET /example_image@90p.src HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 03 Feb 2023 03:41:49 GMT
Content-Type: application/xml

The preceding request resizes the original image by proportional scaling. The scaling percentage is 80%. Because the original resolution is 20000 × 40000 pixels, the height of the output image is 40000 × 80% = 32000 pixels, and the width is 20000 × 80% = 16000 pixels. The output height exceeds the 16,384-pixel limit, which causes the error.

Solution

When you resize an image by fixing one edge or by proportional scaling, adjust the request parameters to ensure that the output dimensions do not exceed the 16,384-pixel limit.

References