Shopify Tip: How to Retrieve Product Images in Different Sizes Via the Image URL

Did you know that you can specify the image dimensions of your Shopify product images via its URL?  This could come in handy for generating product feeds that require specific image dimensions.

For example, you may need to generate a product feed that requires a field for the image thumbnail URL.  Instead of re-uploading the thumbnail version of the images, you can actually just add a width and height parameter directly in the original full image URL.

To demonstrate this, let's look at this sample URL:

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

This is the URL to the full image which is very big:

To resize this image to a width of 200px, we can simply add &width=200 to the URL:

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

Now it's much smaller:

You can specify the height as well:

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

The dimensions will automatically adjust so it's scaled properly and doesn't look stretched.

If you need to generate a product CSV export with image URLs of different dimensions, then you can simply append these parameters to the original image URLs.  And if you need to do this frequently, our EZ Exporter app can also automate this for you by using Custom Fields.

I hope this little trick proves useful!


Related Posts:


Tags: ez exporter, howto, shopify tips, product feed, shopify product feeds