In <vendor>/<theme>/etc/view.xml
you should be able to adjust the settings of the image to remove the frame, like this:
<image id="category_page_grid" type="small_image">
<width>610</width>
<height>360</height>
<frame>false</frame>
</image>
However, there is an issue where setting <frame>
to false returns true. See this Github issue, it was recently merged into the develop
branch. If you're not using the develop
branch for your site you'll still need to use the below fix until it's offically released:
After creating a plugin to convert the string value to an integer (which
properly casts to a boolean), the image frame is not added.
public function beforeSetKeepFrame($image, $keep)
{
if (is_string($keep)) {
$keep = (strtolower($keep) === 'true') ? 1 : 0;
}
return [$keep];
}
->setKeepFrame(false)
. You can find this on this classMagento\Catalog\Model\Product\Image