How do I make the image sizes a custom aspect ratio?

How do I make the image sizes a custom aspect ratio?

hollypie002
Tourist
17 0 1

Hi! I would like to make give the product images on my product grid a 5:4 aspect ratio without adapting the size of the images themselves (they are uploaded square). I would also like to change the ratio on the default product page so that it is also 5:4 rather than a square. Is this possible? Thank you!

Shopify help 4.jpg

Replies 3 (3)

LizHoang
Shopify Partner
1251 159 195

Hi @hollypie002, thanks for reaching out.

 

To address the issue, please help me follow the below-detailed steps: 

 

1. Navigate to Theme -> Edit code. https://prnt.sc/btBdiFPCpXOT

 

2. Open the setting_schema.json file => Click on the content => Press Ctrl + F (or Command + F on Mac) and search for the keyword Product cardhttps://prnt.sc/0Huw0XhvNQ0b

 

3. Insert the following code a little below the "options" line: https://prnt.sc/fNYhVoiVodDg 

 

          {
            "value": "1.25",
            "label": "5:4 aspect ratio"
          },

 

Further explanation: 

 

1. Value: 1.25 represents the aspect ratio of 5:4, where 5 is the width and 4 is the height. You can adjust the value to another ratio as needed, as long as it is enclosed in quotation marks ".

 

2. Label: The text entered here will appear in the settings menu, and please feel free to customize it to your preference.

 

This is the result in the theme's settings and preview: 

 

result 1.png

 

I hope my solution is helpful to you.

 

Liz

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Check our Joy Rewards & Loyalty Program
hollypie002
Tourist
17 0 1

Hi Liz, 

Thank you for your response. I have just looked and there is no line with 'Product Card' in it under setting_schema.json. 

Am I missing something? Thanks!

LizHoang
Shopify Partner
1251 159 195

Hi @hollypie002, thanks for your feedback. 

 

May I ask about the Theme you're using to assist you further? 

 

I look forward to hearing from you. 

 

Liz

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Check our Joy Rewards & Loyalty Program