Images Over 20 Megapixels Disappeared When Uploaded via Shopify GraphQL Admin API
I discovered that images over 20 megapixels disappear when uploaded via Shopify GraphQL Admin API, so I’ll share this finding.
When specifying images over 20 megapixels in Shopify GraphQL Admin API mutations productCreate and productUpdate, they disappeared.
As a solution, consider adding validation for both megapixels and file size (in megabytes) to the image upload process.
Upload Restrictions
There are restrictions on image uploads to Shopify in both megapixels and file size (in megabytes). Megapixels are used to indicate the pixel composition count of an image (in millions). Megabytes are used to indicate the amount of memory or disk space an image occupies (in millions).
You cannot upload images to Shopify that exceed any of the following limits:
- 20 megapixels
- 20 megabytes
To know an image’s megapixels, use (pixel width x pixel height)/1,000,000. For example, an image with resolution 4900 x 6930 would be (4900x6930)/1,000,000 = 33.9 MP, so 33.9 megapixels.
Source: 画像のアップロード · Shopify ヘルプセンター
That’s all from the Gemba about being troubled by images over 20 megapixels disappearing when uploaded via Shopify GraphQL Admin API.