I am trying to get magento 2 to resize my images to a set width and height then crop them to the correct dimensions. I am trying to do this via view.xml and php but both are running into the same problems
I have looked around at a few different guides and similar questions. http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-images.html has instructions on what options I can change
Aspect Ratio: I do not want my images to be stretched so I set this to the true.
Frame: I do not want a frame around my image so I set this to false.
Constrain: This seems to have no effect on my images and only seems to be for cases where the image is smaller than the desired dimensions.
I have fooled around with different options and started looking into the core code. I can get an image the right size by turning aspect ratio off but the image becomes stretched. I can get an image the right size by turning on frames but that will add frames to the side/top/bottom of my image.
As far as I can tell Magento 2 has no way to remove parts of images with the default image resizer. It seems it can only resize and add frames. This is something that I know other systems can do (as I currently rebuilding a woocommerce site in magento 2) and will be something clients demand.
My current possible solutions to this are:
Crop all images outside magento then re-upload (this is unacceptable as client will continue to upload images with incorrect dimensions and we may want multiple aspect ratios within the system)
Hack/extend the core to add the ability to crop images when resizing. This does not look easy from what I have seen and I am curious if there is a 3rd party extension/easy solution that I have missed in my searching.