@lychee128
Could you try the following code and add it in the child-theme/functions.php
add_filter( ‘woocommerce_get_image_size_gallery_thumbnail’, function( $size ) {
return array(
‘width’ => 150,
‘height’ => 150,
‘crop’ => 0,
);
} );
Thank You
Hi,
Thanks for your suggestion. Unfortunately, adding this to my functions.php didn’t seem to make a difference. I even regenerated the thumbnails and that didn’t seem to help.
One odd thing I’ve noticed is that if I use a square product variation image regardless of size (eg, 800px x 800px), the thumbnail image is scaled down perfectly (small image but entire image can be seen).
However, if I upload a rectangular variation image that is a really small size (eg, 100px x 50 px), the corresponding thumbnail image looks zoomed in, even more than when I upload the large square image.
It seems that the cropping of the thumbnail is affected by the aspect ration of the variation image. So basically, a very small resolution rectangular will have more cropping than a very high resolution square image (which have no cropping).
To test, I’ve tried several variation swatch plugins and their behavior is the same. I contacted all the plugin authors and they all say basically the same thing… that they are just using WooCommerce to call the image and not doing any cropping.
Hopefully this make sense.
Any other suggestions? I don’t want to have to transform all my photos into square imageS just to prevent cropping.
Thanks!