How can I get the URL for specific sizes of my product images?

Shopify image URLs typically looks something like this:

https://cdn.shopify.com/s/files/1/1165/2200/products/Sleeping-Cat.jpg?v=1501485987

If you need the image URL for a specific dimensions, you can actually just append something like _1024x1024 right before the .jpg portion. For example, if you want the image URL of the image size of 480x480, you can do something like this:

https://cdn.shopify.com/s/files/1/1165/2200/products/Sleeping-Cat_480x480.jpg?v=1501485987

To automate the process with EZ Exporter, you can use a formula like this one below in a Calculated Field:

{{ image.src }}.replace(".jpg", "_1024x1024.jpg")

Note, however, that this assumes all your images are .jpg files. If you use other formats such as .png and .jpg, you can simply use multiple .replace() like this:

{{ image.src }}.replace(".jpg", "_1024x1024.jpg").replace(".png", "_1024x1024.png").replace(".gif", "_1024x1024.png")

Related Articles:


App: EZ Exporter

Tags: advanced features, images