cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.0 product image cache resizing images

Magento 2.3.0 product image cache resizing images

Hi,
sorry i dont understand the link you send me but i have very big problem with images i dont understand what making it.
All my images are 1024X1024 HQ images. When Magento 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? 
before.PNG1.PNGcache copy.PNGafter.PNG
5 REPLIES 5

Re: Magento 2.3.0 product image cache resizing images

Hello @decornmore ,

 

Magento stores product images as:

media/catalog/product/<first_letter>/<second_letter>/<image_name>

 

However when rendering images are resized as required by specific blocks and saved to cache. It's done to improve performance and perform resize operation only once. That is why when your clear cache then the change you have done statically to the file /pub/media/catalog/product/cache/b3b166914d87ce343d4dc5ec5117b502/ is overridden

 

You can try

 

In etc/view.xml of your current theme, you can update product image size

Make sure you resize with the expect ratio.

Use additional tag <frame> to prevent white borders on image. Use this code as example:

 

<image id="product_page_main_image" type="small_image">
<width>460</width>
<height>460</height>
<aspect_ratio>true</aspect_ratio>
<frame>false</frame>
</image>

Check all other tags, not just a tag with the id `product_page_main_image` check others too.

 

Hope it Helps !! Please accept as solution and kudos if it works for you!

 

Re: Magento 2.3.0 product image cache resizing images

Hi,

i have try it and its not working. i have made new test prodact to see how it will look but its not working at all.Screenshot_1.png

Re: Magento 2.3.0 product image cache resizing images

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? 

Re: Magento 2.3.0 product image cache resizing images

no other offer how to solveit? 

Re: Magento 2.3.0 product image cache resizing images

Hi @decornmore,

Please go thought once magento 2 following document for image thumbnails.  
https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/themes/theme-images.html

In this document 
All image properties used in view.xml should be listed in the order shown here to prevent a“This element is not expected.”frontend error. The following table contains the list of all properties which can be configured: may help you. 

aspect_ratio and constrain
property will help you. 

For image Properties following document may help you. All properties are described with an example. 

https://nwdthemes.com/2017/12/19/magento-2-product-image-size/

I hope it will help you!