Magento – Magento 2.3.0 product image cache resizing images

image resizingmagento-2.1magento2media-imagesproduct-images

All my images are 1024X1024 HQ images. When magneto move the imaged to cache folder it resize it and make i get smaller images with white frame all around it (see images "before"). 
I try to fix it by changing the etc/view.xml file but same problom. to fix it i have copy all images from /pub/media/catalog/product/ TO /pub/media/catalog/product/cache/b3b166914d87ce343d4dc5ec5117b502/
same location the images show on . This have fix the problem BUT after 24H images go back to same size with the white frame. 

Can you understand what making it ? how it can be that after 1 day the cache images change back again? 

Thankswhite frame
after fix
copy images

Best Answer

You need to set image sizes in view.xml file inside your theme

Code would be like this:

<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="bundled_product_customization_page" type="thumbnail">
                <width>140</width>
                <height>140</height>
            </image>
            <image id="cart_cross_sell_products" type="thumbnail">
                <width>200</width>
                <height>248</height>
            </image>
            <image id="cart_page_product_thumbnail" type="small_image">
                <width>165</width>
                <height>165</height>
            </image>
            ........
        </images>
    </media>
    ......
</view>

Make sure your all images sizes are 1:1 ratio, as your main image proportion is 1:1 in ratio, than after frontend deployment it should work

php bin/magento setup:static-content:deploy -f
Related Topic