3

I am absolutely confused to hell with view.xml image cropping. I am just trying to take the images I have uploaded and crop them to a square size using the etc/view.xml file from my theme.

I have tried everything possible and the closest I can get to square cropped images is:

<image id="product_page_image_medium_no_frame" type="image">
    <width>886</width>
    <height>886</height>
    <constrain>false</constrain>
    <aspect_ratio>false</aspect_ratio>
    <frame>false</frame>
</image>

However, the image is just stretched into this square box, its not cropped from the centre. Any help would be greatly appreciated.

ItsJhonny
  • 389
  • 2
  • 12

1 Answers1

2

So, I have figured out that the best I can get is with the following. Unfortunately, unlike Magento 1 there is no 'hard crop' option available. Frames it is then.

<image id="product_page_image_medium_no_frame" type="image">
    <width>886</width>
    <height>886</height>
    <constrain>false</constrain>
    <aspect_ratio>true</aspect_ratio>
    <frame>true</frame>
</image>
ItsJhonny
  • 389
  • 2
  • 12