cancel
Showing results for 
Search instead for 
Did you mean: 

Magento site image issues

Magento site image issues

Sometimes our magento site will not render a picture for a particular product or products on some browsers. For example, on Chrome, if it doesnt show, then if you open a window in incognito it works fine.  But non incognito window, you have to clear cache.  But this missing image occurs sometimes not all the time.  Has anyone experienced this, can anyone help.

 

Also it is not all images, so on a page we may have 20 images for one category but one may be missing. But if I have another person try it works ok for them, but then for me if I try incognito it works ok.  On a browser where it doesnt initially work I have to clear my cache.  Any help will be appreciated. 

 

6 REPLIES 6

Re: Magento site image issues

HI @batis _malekpou,

It looks like cache issue and permission issue. 

 

You can try following command.

sudo find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento

sudo chmod -R 0777 var/ pub/ generated/


For some products images are showing, may be cache are not generted for them. 

You can try once following commands to regenerate images cache. 

php -dmemory_limit = -1 bin/magento catalog:images:resize

I hope it will help you!

Re: Magento site image issues

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Generator" content="Microsoft Exchange Server" />

.EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; }

Hi



Thank you. But for the image that isn’t showing on my browser shows on another in incognito mode and some else gets it fine on another browser.  Would that command help for that too ?



Re: Magento site image issues

@batis _malekpou 

There are nothing related to browsers for the product images in the magento. Looks like there is only issue with cache and permission. 

Try once above solution. 

Might be it will work for you!

Re: Magento site image issues

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Generator" content="Microsoft Exchange Server" />

.EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; }

Thank you. I will. Just have another question for you. So we have 1 magento server so I wanted to know because I can’t make sense of why when I go sometimes I get missing images. Not always but at the same time while I get it missing someone else sees it. Or if I use incognito I see it.



Apologies on these questions. I am a novice at magento.



Thank you again.



Re: Magento site image issues

No problem.

Yes, this is strange behavior.
I suspect only on image cache file. May be it is not generated first time on load.

So I have suggest to regenerate image cache using command which I mentioned.

Also make that don't flush the media cache after that. When we flushed the media cache it removes all cache images.

Re: Magento site image issues

Hello @batis _malekpou 

It may happen because of Magento images cache generation generates wrong hash for some images with a custom theme that has the keep_frame var set to 0

So try to rename the cache folder of pub/media/catalog/product/ Provide the permission as suggested by @vimal_parihar 

sudo find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento sudo chmod -R 0777 var/ pub/ generated/ 

And then execute the command :

bin/magento catalog:image:resize 

Hope this will help you. If the issue still exist then please look this link once, I hope this will help you https://github.com/magento/magento2/issues/19710

If it helps you, please accept it as solution and give kudos.

Regards.