Upload media to Shopify

Implementing the instructions from this link:
Upload media to Shopify

It appears that the temporary server (googleapis.com) does not accept the same specs for image uploads than Shopify. I’m finding that many times (it’s not consistent with resolution size) my uploads to googleapis are failing. Sometimes images at 4000x4000 pixels are failing, sometimes they are successful (same image, I’m just changing resolution). 4000x4000px is only 16 megapixels (20 being the max for Shopify). Any ideas what the issue might be?

thanks,
Ron

Are you getting any specific error back when trying to upload the image?
Is the size of the image when its compressed?

I’m not 100% sure, I think it was “bad result”. But this morning, things are a bit different. I’m able to get an image a bit higher than yesterday (4200x4200). 4300x4300 fails with message “Metadata,part,is,too,large”. I did post a message about this (yesterday) on the page “Upload media to Shopify”, so I’m not sure if they are looking into it. Yesterday, the same exact image (no changes to resolution) would sometimes fail, but sometimes work just fine (no changes to image or my code).
Image info that fails (today):

  • File type: jpg
  • File size: 2.06 MB
  • Resolution: 4300x4300
  • Megapixels: 18.5
    Results seems to be consistent today.

If you reduce the resolution size of the image, does it work consistently?
Wondering if you’re just getting too close to the limits

Today, just a couple minutes between…
4200x4200 = pass
4210x4210 = pass
4220x4220 = pass
4230x4230 = pass
4240x4240 = pass
4250x4250 = fail
4300x4300 = fail
4250x4250 = pass ← failed before
4250x4250 = pass ← failed before
4300x4300 = fail
4300x4300 = fail
4250x4250 = pass
Not sure why Shopify can’t have images uploaded directly (as they did with REST). Why have them uploaded to Google, then transfer to Shopify. The inconsistency is really the issue. You can reliably put in your code “Images under X resolution only”. Does it depend on how busy the google server is at the time?

Sorry I meant if you try 3000 x 3000?

Couple of other thoughts:

  1. If you back off and retry the request does it pass? Retries is generally a good approach for requests anyhow
  2. If you have a URL for the image already you can skip that upload step and just add it to the product for example the original source of the media object. Can be an external URL for images Manage media for products

Based on my testing, I think 3000x3000 would work most times.

Maybe I’ll just allow images under 4000x4000, and hopefully this will be sufficient.
Final thought: If Shopify has set up a google account/server for this purpose, it really should support their file size specifications.
Resolution Maximum of 20 MP (megapixels)