2

I am trying to force all the images in the product grid to square. The database serves images from ultra wide to ultra high ratios.

i'm trying the following:

$productImage = $imagehelper->init($product, 'category_page_grid')
                ->constrainOnly(false)
                ->keepAspectRatio(true)
                ->keepFrame(false)
                ->resize(400, 400)
                ->getUrl();
            ?>

But whatever i try i always seem to be getting white space for the images that have a high image ratio (side note i do not want the aspect ratio to be distorted) .. what i want is magento to look for a square in the middle of the image and just cut off the rest, no matter if it's high or wide.

anyone have an idea?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.