I tried to resize product image in product description page and it does successfully however, it shows too much space around image. I need to put product detail tab below the product image but it shows so much space around image. Please advise me how to remove that space around product image.
<transparency>false</transparency> I have used this tag but still it shows so much space around image.
Do you have a screenshot you could share to better explain the issue?
It could be that the dimensions that you're requesting to the display the product image doesn't match the aspect ratio of the images uploaded to admin. So in order for Magento to resize to fit, it needs to add white space around two sides of the photo.
hey @amitgandhi21 please try to
<image id="category_page_list" type="small_image"> <width>240</width> <height>300</height> <transparency>false</transparency> <aspect_ratio>false</aspect_ratio> <frame>false</frame> </image>
Error happened during deploy process: The XML in file "/home/.../etc/view.xml" is invalid:
Element 'aspect_ratio': This element is not expected. Expected is ( background ).
Verify the XML and try again.
(This issue is happening if not both elements width and height are specified.)
Here are some tips to remove white space around product images in Magento 2 Luma:
The key is using a combination of layout XML, CSS, high quality images and eliminating unnecessary elements that cause extra whitespace around images.