0

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

  • have you make any cron for image resizing? – Rutvee Sojitra May 22 at 6:24
0

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
  • Hi,i try it and its not working for me. – schnitz May 23 at 6:24
  • Hi,i try it and its not working for me. – schnitz May 23 at 6:25
  • Which file did you edit? I have applied this solution before and it always works – Shoaib Munir May 23 at 6:27
  • this solution (tried to update the etc/view.xml ) i have try over and over again i have try to tried to update the etc/view.xml with different image size and could not solve the issue. I see that the extension of Fotorama used in the product details page can this extension resize the image and white background issue? – schnitz May 23 at 6:36
  • search with the keyword keepFrame=false, it will remove white space despite of size and ratio – Shoaib Munir May 23 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.