Skip to content

mini_cart_product_thumbnail not sizing to values set in etc/view.xml

I have my image sizes set in my app/design/frontend/My_Design/My_Theme/etc/view.xml but for some reason, the values for mini_cart_product_thumbnail are not being used in the minicart.

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <media>
        <images module="Magento_Catalog">
            ...
            <image id="mini_cart_product_thumbnail" type="thumbnail">
                <width>76</width>
                <height>76</height>
            </image>
            ...
        </images>
    </media>
</view>

I have tried changing the type from thumbnail to small_image but it makes no difference.

Inspecting the output HTML, I see that the image sizes are being set to auto:

<img class="product-image-photo"
data-bind="attr: {src: src, alt: alt}, style: {width: 'auto', height: 'auto'}"
src="image_url" alt="Image Alt Text" style="width: auto; height: auto;">

The visual result is thus:

Mini-Cart showing very small product image

Other places using this same XML file are adjusting the sizes accordingly, any thoughts greatly appreciated.

Many thanks.