The uploaded image is corrupt and cannot be processed. Please try a different image.

konst
New Member
2 0 6

Hello!

I am trying to upload images for a few thousand products via API.

All images are in the PNG format.

Most of the images (99.9%) are uploaded without problems. But a few images return this error:

422/Unprocessable Entity The uploaded image is corrupt and cannot be processed. Please try a different image.

It does not depend on the size, I get this errors with images with different sizes and larger images are uploaded correctly. The same images give this error again and again.

I use POST with only `filename` and `attachment` field.

Here are xRequestIds for a few recent failed requests:
c6ea44f2-6db7-44e1-bf3e-6c9aae9495b2

40310296-1084-45ea-beed-db2b597de197

30ae4820-14f6-45f0-8f74-b30560dac6ab

Can you look in your log and find the problem, please?

Thank you!
Kostyantyn

vix
Shopify Staff
Shopify Staff
535 105 105

Hi @konst 

 

Thanks for the information. The error I am seeing is that the image failed due to: Could not determine dimensions. Please review our documentation here for more advice on image sizing: https://help.shopify.com/en/manual/products/product-variant-images

 

 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

konst
New Member
2 0 6

Thank you!

 

It looks like the failed images have bigger height than is allowed.

 

It would be good (I would say necessary for API users) to have more correct and meaningful error messages in the API error responses. The message "The uploaded image is corrupt and cannot be processed" is absolutely misleading. The image is OK, but your API just refuses to process it because one of the possible reasons. This case it is a too big image height. In other cases it can be a too big width or too big image size.

The message "Could not determine dimensions" is not very clear. Why not "Your image height XXXX is greater than the allowed height YYY".

Developers need detailed error information. It is not difficult to implement, is it?

MarkDelta
New Member
2 0 7

I agree with konst. 

It's an equivalent of Windows "Something Happened" error. It's useless, and very annoying to work with when I have to spend 2 hours of my life due to lazy coding of a platform I pay for. 

0 Likes
Shayne
Shopify Staff
Shopify Staff
202 9 46

@MarkDelta wrote:

I agree with konst. 

It's an equivalent of Windows "Something Happened" error. It's useless, and very annoying to work with when I have to spend 2 hours of my life due to lazy coding of a platform I pay for. 



Honestly, fair assessment. I'll talk to the team.

Shayne | Developer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
It_s_me
Explorer
40 0 54

Hasn't been fixed tho...

0 Likes
ImadSabiri
New Member
1 0 0

Still Not Fixed.....

0 Likes
CuraTech
New Member
1 0 0

UP!!

0 Likes