Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Gifs randomly not loading

more options

I noticed this strange behaviour on my website: animated Gifs sometimes are just not displayed. This is random refreshing the page (very persistent in some cases), and can happen on any or all of the gifs in every page. If you right-click and inspect the gif, or open it in another tab it loads just fine, so I really don't know why this could happen.

Clearing the cache, navigating incognito, permissions etc. don't solve the problem. This can happen also if you visit the website for the first time.

I'm having this trouble on multiple devices, even of other people, with Firefox. While I cannot reproduce the issue with other browsers (chrome, edge, etc.).

Can someone give me a clue on how can I solve this? Or eventually confirm this is a firefox issue? You can check here: Website

Thank you

All Replies (16)

more options

Please provide a public link (no password) that we can check out. No Personal Information Please !


Make sure you are not blocking content.

Start Firefox in Safe Mode {web link}

A small dialog should appear. Click Start In Safe Mode (not Refresh).
Is the problem still there?


https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop

Helpful?

more options

FredMcD said

Please provide a public link (no password) that we can check out. No Personal Information Please !

Make sure you are not blocking content.

Start Firefox in Safe Mode {web link}

A small dialog should appear. Click Start In Safe Mode (not Refresh).
Is the problem still there?


https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop

The problem is still there, I've tried safe mode and disabled tracking protection. I've put the link in the first message, this is the website: https://discordia.enghouseinteractive.it/

Thank you

Helpful?

more options

Many site issues can be caused by corrupt cookies or cache.

Warning ! ! This will log you out of sites you're logged in to. You may also lose any settings for that website.

Helpful?

more options

FredMcD said

Many site issues can be caused by corrupt cookies or cache. Warning ! ! This will log you out of sites you're logged in to. You may also lose any settings for that website.

Thanks, but I already tried, as said in the first post, cleaning cache, cookies, incognito mode and I'm also able to reproduce the issue on other devices (tried with several people). This just happens with firefox, not with Chrome or Edge.

Did you try to visit the website and maybe refresh a few times? didn't it happen to you?

Helpful?

more options

Some animated GIF images can actually be MP4 video files.
You can check the Web Console for relevant messages.


You can check the Web Console (Tools -> Web Developer) for messages about blocked content and about the presence of mixed or unsafe content.

You can check the Network Monitor to see if content is blocked or otherwise fails to load.

If necessary use "Ctrl+F5" or "Ctrl+Shift+R" (Mac: Command+Shift+R) to reload the page and bypass the cache to generate a fresh log.

Helpful?

more options

I had no problem. I called for more help.

Start your Computer in safe mode with network support. Then start Firefox.
Try Secure websites. Is the problem still there?

http://encyclopedia2.thefreedictionary.com/Linux+Safe+Mode
Starting Any Computer In Safe Mode; Free Online Encyclopedia

Helpful?

more options

Still getting the problem in safe mode.

What I was able to notice is that, if i look at the network monitor -> images, when refreshing the page I don't see the GIFS that get a "304 Not modified" result, while Ctrl+F5 usually cause them to get a 200 and display them correctly.

So, it seems like the first page load downloads all the gifs and displays them correctly, while a simple refresh causes them to be "fetched" in cache, but resulting in not displaying them at all. Also, it is not so "strict" as a rule: some gifs are displayed even with the 304. I'm attaching a few screenshots highlighting this.

Any idea why should firefox experience issues in reloading a page and fetching media from the cache if it gets a 304? Maybe this is not either related to the problem...

Helpful?

more options

I called for more help.

Helpful?

more options

FredMcD said

I called for more help.

Thanks a lot!

Helpful?

more options

I would characterize this problem differently: the GIFs load, but after a reload, most of them do not "play" through their frames to the end and just show a transparent frame.

If the GIFs were not loading, the ALT text would appear in their place, which is not happening (but if you intentionally munge the URL in the Inspector, you'll see it).

Weirdly, the one for location loads even when the other 6 do not.

So... what could cause that? I suspect something about the scroll-linked animation is causing the problem, but I really have no idea how the events work in the page.

If I create a static page where the images just load without all the sliding bits -- example: https://www.jeffersonscher.com/temp/img-sized.html -- Firefox shows them after a reload, albeit just the last frame rather than fully animating if they are in the cache. I'm not sure why on your page Firefox gets stuck on an earlier frame instead.

Helpful?

more options

If I check some of the images in GIMP then I notice that there are a lot more frames then Firefox is showing, so I'm not sure if there is something wrong with the way the actual animation is coded in the image (I do not have software that decodes this data) or Firefox might stop if there is a blank frame. I've also seen all images disappearing if I leave the page for a while.

The first image disappears so quickly that I can't include it in the screenshot.

Helpful?

more options

jscher2000 said

I would characterize this problem differently: the GIFs load, but after a reload, most of them do not "play" through their frames to the end and just show a transparent frame. If the GIFs were not loading, the ALT text would appear in their place, which is not happening (but if you intentionally munge the URL in the Inspector, you'll see it). Weirdly, the one for location loads even when the other 6 do not. So... what could cause that? I suspect something about the scroll-linked animation is causing the problem, but I really have no idea how the events work in the page. If I create a static page where the images just load without all the sliding bits -- example: https://www.jeffersonscher.com/temp/img-sized.html -- Firefox shows them after a reload, albeit just the last frame rather than fully animating if they are in the cache. I'm not sure why on your page Firefox gets stuck on an earlier frame instead.

This makes more sense! Seems like they don't play after a reload and get stuck on the first frame (or the last frame, on your example page) Is this a known issue with firefox? (this is not happening with other browsers) Do you have any documentation regarding "best practices" to export gifs for better compatibility with firefox, if this could be the problem?

I've also tried to remove all the animations, but same result, so I don't think this is related to the problem.

Helpful?

more options

I left Jeff's page open for a while and they "disappear" here as well... this is driving me crazy :D

Helpful?

more options

Unfortunately I don't know the answers to why the animated GIFs do not (A) replay on reload, and (B) stay on the last frame indefinitely between reloads.

Firefox has a built-in preference named image.animation_mode which allows users to control repeated animations. Its possible values are:

  • normal -- play through, and if it loops, loop continuously (default)
  • once -- play through, but don't loop
  • none -- don't play the frames (should show only the first frame?)

I assume all of us have the default setting of normal so this isn't a factor.

Perhaps there was some other change if Firefox used to work fine with these images?

Helpful?

more options

This is an interesting page for me:

Image 1/5/6 animate only once and then stops, image 2 keeps looping (image.animation_mode = normal; once doesn't loop) and image 3/4 animate once and then show an empty frame.
This is the same in Firefox 52/68 ESR and in Firefox 77 and in Firefox 79.

Helpful?

more options

Ok, I think there is more than one problem here.

I managed to solve the gifs not playing after reload with a javascript workaround, that adds the Date to the img source to make the browser think it's a new resource to download:

var elements = document.getElementsByTagName('img'); for (var i = 0; i < elements.length; i++) { if (elements[i].src.includes(".gif")) { var gifSource = elements[i].src; elements[i].src = gifSource+"?"+new Date().getTime(); } }

This way it seems they are always displayed on page load.

Now the other problem is that after some time they "disappear", but here I think there's something wrong with the gif frames... I'm not sure, but it is possible that after the last animation frame they stop at the first one, which is an empty frame. I have to figure out if there's a way of setting the GIFS to end the animation and stop at the last frame, instead of going back to the first one, or some other workaround to make them "visible" after the animation.

Thanks everybody for the precious help, I wouldn't have figure this out without your advices :)

Helpful?

Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.