Problem description
The upload callback returns empty values for imageInfo.height, imageInfo.width, or imageInfo.format even though these parameters are specified in callbackBody.
Causes
OSS cannot retrieve image information from the callbackBody parameters. This can happen when the upload itself failed, the image was deleted before the callback ran, or the image is in a format that OSS does not support for image information queries.
Examples
You specify imageInfo.height, imageInfo.width, or imageInfo.format in callbackBody when uploading an image. After the upload completes, the callback returns empty values for those parameters instead of the expected image dimensions and format.
Solutions
Work through the following checks in order to isolate the cause.
Check whether the upload succeeded. A failed upload produces no object in OSS, so
callbackBodyhas no image to query. Confirm that the upload returned HTTP 200. If the upload failed, call PutObject to re-upload the image, then retry the callback.Check whether the image still exists. Even after a successful upload, the image may have been removed before the callback ran. Verify that the object has not been deleted by a lifecycle rule or by another user.
Check whether the image format is supported. OSS image information queries support only the following formats: JPG, PNG, BMP, GIF, WebP, TIFF, and HEIC. If the image is in an unsupported format (for example, SVG or RAW), convert it to a supported format before uploading.
Verify that the image itself is queryable. Upload the image to OSS and run the following request to test whether OSS can read its image information:
https://<bucket-name>.<oss-endpoint>/<object-key>?x-oss-process=image/infoA successful response returns a JSON object with fields such as
height,width, andformat. If the response is empty or returns an error, the image file is likely corrupted or in an unsupported format.Rule out environment issues with a known-good image. To determine whether the problem is with the image or with your environment, run the same test against the OSS demo image:
https://image-demo.oss-cn-hangzhou.aliyuncs.com/f.jpgIf this request returns image information but your image does not, the issue is specific to your image (format, corruption, or encoding).
If this request also returns empty, the issue may be with your network or OSS configuration.