Open Bug 129986 Opened 22 years ago Updated 2 months ago

Cached Gif animations don't reset on reload.

Categories

(Core :: Graphics: ImageLib, defect, P3)

defect

Tracking

()

Future

People

(Reporter: caspy77, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file, 1 obsolete file)

When I go to http://www.sentex.net/~mmcadams/teachgo/cap4.html the gif animates
without a problem.  However when I hit reload the animation does not reset and
stays at the last frame.  On NS 4.x & IE 5.5 hitting reload resets the animation.
Build 20020306 on win98.

P.S. I don't know the lingo well enough to tell if this is a dup of bug 116535.
Confirmed on Linux as well.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
Hardware: PC → All
shift-reload works (no real surprise)
Blocks: 119597
Target Milestone: --- → mozilla1.1beta
*** Bug 145348 has been marked as a duplicate of this bug. ***
Depends on: 152756
http://www.sentex.net/~mmcadams/teachgo/cap4.html
(watch animation, press reload, see animation go again)

Marking Fixed 2002101010 on Win2k
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 171878 has been marked as a duplicate of this bug. ***
Sorry, I was out of town or I'd have caught this sooner.  

This bug does not appear to be fixed - at least on windows 98 using 1.4rc3.
When I go to the example page and hit reload the animation does not reset.
Status: RESOLVED → REOPENED
OS: All → Windows 98
Resolution: FIXED → ---
*** Bug 175509 has been marked as a duplicate of this bug. ***
*** Bug 190016 has been marked as a duplicate of this bug. ***
Still a problem on 1.7 RC2 inder Win XP.

Kind of annoying...
I don't see it happening, using:
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/2004-03-05
Firefox/0.8.0+
But I see it happening, using:
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/2004-03-09
Firefox/0.8.0+

Maybe a regression from fixing bug bug 57607?
*** Bug 249411 has been marked as a duplicate of this bug. ***
*** Bug 251053 has been marked as a duplicate of this bug. ***
*** Bug 259593 has been marked as a duplicate of this bug. ***
I can't beleive this bug still isn't fixed.  I reported it early in 2002 (even
though my report was a duplciate of this problem).  :-(  This browser will never
be world class when it takes more than 2 1/2 years just to fix a bug with
loading animated gifs.  
Confirmed: 
WinXP SP2, Oct-6-04  Firefox build (.10.1)

I'm not sure what ArronM saw, but when I view that page, the animation goes.
Reload, animation does NOT go. Shift-reload and it does.


Agree with previous poster, this bug's been here for 2 years, apparently because
no one's interested in fixing it?
I don't know what the reason is, but here is a site that I created where I 
first noticed the problem:  http://www.lifechoicescoaching.com/home.html

As you click on the buttons on the left frame, the "Life Choices" animated
gif on the top frame should change colors. It should re-animate each time 
you click any of the buttons on the left.  I can't even get the animated
gif to re-animate with mozilla after reloading the frame manually. 
i cant understand that, too. Its unbelievable. i want my animated background
gifs also running on a:hover in the background. Why is nobody fixing it?
BTW, shift+reload does nothing for the site / gif I described in my last
comment (#16). http://www.lifechoicescoaching.com/home.html
In a servlet, I do something like

response.setHeader("Cache-Control","no-cache, no-store,must-revalidate,
max-age=-1");
response.setHeader("Pragma","no-cache, no-store");
response.setDateHeader ("Expires", -1);
response.setContentType("image/png");


and proceed to send a dynamically generated graph.  The image does not refresh
(Firefox 1.0.5 on XP SP2).  This works in IE, though.

A work-around is to add unique junk to the request url every time.
Gee.. only 10 months since my last update about this bug.  I've given
up hope that it will ever be fixed.  <sigh>
re comment #19:

How does a problem with dynamically generated PNG images not being
auto-refreshed from a server have anything at all to do with this bug, which is
about static-file GIF animations not replaying on the client side in response to
a reload command?
Hello,
Excuse me for my bad English.
I have the same problem and I think that the problem occurs when the Gif animations are in html-frames.
Nice to see that this still isn't fixed in Mozilla Firefox 2.0.  :-(
It's only been 5 years though.  
I reported this as a new bug by mistake (376797).  At least I'm not the only one to make the mistake.  I notice the OS is listed as Windows 98.  The bug occurs in both Windows XP and Mac OS X.  Would changing the OS raise the hopes of getting this fixed?
Probably not, but I'll change it just for completeness' sake.
Assignee: pavlov → nobody
Status: REOPENED → NEW
Flags: blocking1.9?
OS: Windows 98 → All
QA Contact: tpreston → imagelib
Target Milestone: mozilla1.1beta → Future
Assignee: nobody → pavlov
Blocks: 377840
Flags: blocking1.9? → blocking1.9-
Whiteboard: [wanted-1.9]
Assignee: pavlov → nobody
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Holy Shnikey!  This things still around?

With no updates for almost two years it just got duped again this month.
The original page I linked to is no longer there, but I found its archive in the Wayback Machine ( http://web.archive.org/web/20071224220221/http://sentex.net/~mmcadams/teachgo/cap4.html ).  But for me it now works.
The two possible differences here are that I'm running FF 3.0.5 on a Mac (I was on windows when originally reported) and the page's code could perhaps be modified from the original in some manner.

The most recent dup indicated FF 3.0.5 and was experiencing the same problem, but did not specify a page or platform (though if we were throwing darts we'd go with Windows).

Are others still able to duplicate this problem?  Please give a URL, your version of Firefox and your platform.

I'm genuinely surprised this is still around as of FF3 and wondering if some code changes in 3.1 fix it.
On both "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5" and "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2"

The image http://web.archive.org/web/20070209042550/www.sentex.net/~mmcadams/teachgo/images/cap4_ani.gif starts animating again after both a refresh and a reload. I'm not sure why, but it seems like web.archive.org is doing something with image caching?

The image http://ftp.uniovi.es/gifanim/gifanim2.gif only animates on first load or after a complete reload. A refresh does not restart animation.

So it seems to be an unresolved issue, atleast on Windows.
Indeed, the second link you provided does not restart the animation on page reload - fitting with the my initial description of this bug.

As I mentioned before, this is on a Mac, v3.0.

Still unresolved.
It isn't fixed.  Well.. partially.  The site I had that failed
used frames.   Now if you refresh the frame or the entire
page,  the animation does reset.  However, if you click on a
link on the left frame, that brings up a different frame at
the top of the page with the gif, it doesn't reset (the gif
is a logo in the frame at the top of the page.

I apologize that I can't give the URL. The site changed from
my original URL (no more animatedgif), but I still have
the pages locally since I developed that site. 

Firefox 3.0.5 and Win-doze XP SP3.   - Regards, Mark
The second link to a .gif in comment #30 displays the issue. Can someone with rights save it and upload/add it as a testcase, so if the site dies we will still have it around to test/confirm the bug?

BTW, I still see it on latest 3.6a1pre nightlies: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090421 Minefield/3.6a1pre (.NET CLR 3.5.30729) ID:20090421041537

thanx in advance.
Attached image Testcase (obsolete) —
Comment on attachment 374193 [details]
Testcase

Of course, now it doesn't reproduce when served from Bugzilla....
Attachment #374193 - Attachment is obsolete: true
Could it be that it was a site specific issue? Any other URLs out there to test/confirm?
(In reply to comment #37)
The link above is a direct link to the image from what I see and know. I think that image needs to be placed on a website. Than Firefox caches it and IMHO somehow that's why it isn't replayed.
I put out the old pages from this website I maintain that shows the bug.

http://www.lifechoicescoaching.com/oldsite/home.html  

This was my original comment (see #16 above):


As you click on the buttons on the left frame, the "Life Choices" animated
gif on the top frame should change colors. It should re-animate each time 
you click any of the buttons on the left.  I can't even get the animated
gif to re-animate with mozilla after reloading the frame manually. 

... open the URL above in IE to see what it should do 

Mark
once again... when served from Bugzilla issue is not reproduced :(
Forgot to say... I still see the problem on Firefox 3.0.8
  - Regards, Mark
Bugzilla's served over SSL, so most things won't be cached from it.
Confirmed on latest nightly build of Shiretoko.
Updating URL with the animated gif URL from comment 30 which demonstrates this bug in a straightforward and repeatable way.
Hitting F5 restarts the animation : http://ftp.uniovi.es/gifanim/gifanim2.gif

Firefox 3.5.5 on WinXP SP3
Hitting F5 didn't do anything for me.  Also using Firefox version 3.5.5 but I am running WinXP SP2 on the machine I just tested on.  I'll try on SP3 in a bit.
Also tried on WinXP SP3 with 3.5.3 and 3.5.5.  F5 did nothing.
Ubuntu 9.10 Fx 3.5.4 F5 also doesn't work, however CTRL+F5 works fine? Tested on image provided above, not sure what with gif's embedded on a web page.
On Mac OS X 10.6.1 running 3.5.5.
Hitting reload still does not reset the animation.

Heh, when I first reported this 7 1/2 years ago I was running XP and tested the issue on Netscape 4. :)
Phew... eight years dealock on this one... Should become fixed, shouldn't it?
the URL of comment 30/comment 46 times out.

Still fails Mozilla/5.0 (Windows; Windows NT 6.0; rv:2.0b3pre) Gecko/20100723 Minefield/4.0b3pre
Reproducible at http://www.lifechoicescoaching.com/oldsite/home.html with
Mozilla/5.0 (X11; Linux x86_64; rv:9.0a1) Gecko/20110902 Firefox/9.0a1
Making it depend on bug 666446, which is redoing the animation framework.
Depends on: 666446
(In reply to Mark S. from comment #45)
> Updating URL with the animated gif URL from comment 30 which demonstrates
> this bug in a straightforward and repeatable way.

FWIW: if I'm viewing the attached GIF directly, then I get expected results (a reload restarts the animation).

However, if I'm viewing a page that uses the GIF (like the one in comment 56), then I can reproduce the bug. (reload does _not_ restart animation)

(In reply to Randell Jesup [:jesup] from comment #57)
> Making it depend on bug 666446, which is redoing the animation framework.

(That bug is primarily about scheduling individual animation frames -- not about when we start/stop/restart animation -- so I suspect it won't have much effect on this bug.  I suppose dependencies are cheap and can be tweaked if necessary once that bug's patches have landed, though. :))
Comment on attachment 374282 [details]
uploading 'lifechoices2.gif' from site on comment #39 as testcase... [this copy won't reproduce the bug, since it's served over HTTPS]

(In reply to Daniel Holbert [:dholbert] from comment #58)
> FWIW: if I'm viewing the attached GIF directly, then I get expected results
> (a reload restarts the animation).
> 
> However, if I'm viewing a page that uses the GIF (like the one in comment
> 56), then I can reproduce the bug. (reload does _not_ restart animation)

Aha -- to clarify, that disctinction is purely due to the image being served over HTTPS vs. over HTTP.

For images served over HTTPS, I believe we re-download them (and create a new RasterImage, etc) on each load, so as not to leak information in timing attacks.  For images served over HTTP, though, we'll happily pull them out of the cache.

So, this bug doesn't reproduce w/ attachment 374282 [details], but it *does* reproduce with http://www.lifechoicescoaching.com/oldsite/lifechoices2.gif due to that HTTP/HTTPS distinction.

Mozilla/5.0 (X11; Linux x86_64; rv:9.0a1) Gecko/20110901 Firefox/9.0a1
Attachment #374282 - Attachment description: uploading 'lifechoices2.gif' from site on comment #39 as testcase... → uploading 'lifechoices2.gif' from site on comment #39 as testcase... [this copy won't reproduce the bug, since it's served over HTTPS]
OS: WinXP Pro SP3
Firefoxes: 3.6.25 & 9.0.1

Please allow me to contribute another source from which this bug can be seen.

SIGNIFICANT:  The problem only appears when the WEB SITE is being viewed.  It doesn't happen when Firefox opens the copy of the logo page that resides on my PC.

Go to  http://www.rogue-eagles.org/

Click on the Rogue Eagles logo in the banner image.

A page with a .gif that animates the logo should open and the animation should run nicely.  Except that the animation never stops.  Here's what I see:

    Clicking the logo opens the animated logo page.  The .gif runs about 22 seconds and loops continuously.
    Clicking the GoBack button goes back to the index page as expected. 
        (In all of these tests, be aware of the "picture" when the animated logo page is closed.)
    Clicking the logo again opens the animated logo page.
        The animation *resumes* at the point where it was when the GoBack button was clicked.
    Clicking the GoForward button produces the same result as clicking the logo again.
    Clicking the Page Reload button while the .gif is running does not stop or restart the animation.
    The .gif never stops running; it only pauses.

    Clicking Reload appears to download a new copy of the page but does not reinitialize the display.
    Clicking SHIFT-Reload will reinitialize the logo page.

Sorry, my only "reference" resource is I.E.
With I.E., the animation can be interrupted and restarted at ANY TIME by clicking the Page Reload button or by leaving and returning to the Logo page.

Is this submission satisfactory or should I open a new bug report?
(In reply to Ron Patterson from comment #61)
> Is this submission satisfactory or should I open a new bug report?

I believe the issue is already well understood IMO, especially considering the high number of duplicates with additional information: it's related with caching interference (server headers, HTTPS) with the animation framework, which makes the behavior to change in some circumstances (Ctrl+F5/Shift+Reload, changing server configuration, etc.). Thanks for your contribution.
BTW Seamonkey has the "Reload Image" option in the image context menu. It is not about full "page reload" (as in this bug title) but related to the same cache+redraw conflict.
Could the issue listed here be the reason for my problem with GIF animations freezing after a mailto action? Or have I misunderstood and mine is a separate issue?

I use a service called Fever to present RSS feeds. A feed with GIFs can load articles within Fever and animate GIFs properly; however, if I email any article using the keyboard shortcut (i.e. mailto) and come back to Firefox (v19), all GIF animations in all articles of all feeds are frozen on the first frame. Until I restart the browser, they will only animate on a individual article basis in Fever if I click-through the originating site and animate it there. This is not a problem in Safari or IE.
Every time I get notified of an update on this bug, I just can't believe it.  I reported in in 2002.  Yes, 11 years ago and it still isn't fixed!    So that this is not a productive post - my last one was 4 years ago.  The web site I originally reported this with is long gone now too.
Updating URL & Summary.

For those just arriving, it seems the crux of the issue here is somehow with cached gifs.
Of particular note is comment 62 and comment 59 which help boil things down.
Gifs served over https are not cached and will restart fine after a reload.  Images served locally also seem to restart fine (I'm guessing we either bypass or ignore caching locally stored images for easy web development).

Are there any circumstances in which we see http, cached gifs actually restarting on reload?

Milan, there's concern this issue has fallen off the radar. Can you give any insight/input about what might be the next steps to fix it or who might be a good person to have a look?
It feels like, as non-developers, we've distilled down as much as possible what's going on.
Flags: needinfo?(milan)
Summary: Gif animations don't reset on page reload. → Cached Gif animations don't reset on reload.
In retrospect, isn't this just the same underlying issue as bug 332973?  See in particular bug 332973 comment 9.  It doesn't look like that connection's been brought up yet, though maybe I missed it.

(I don't know the mechanics of the image cache well, but we could presumably fix this bug here independently of bug 332973 by adding some logic to detect when the last consumer of a cached animated image goes away, and reset its animation state at that point...)
(not that that would be an especially robust solution, because if you happen to have the image open anywhere else, then you'll fall prey to bug 332973. Maybe that'd be a rare case, though; it's probably rare that people have the same animated image open in multiple tabs and also care about the state of that animated image)
If I was a developer I would try to make a proper image load design from scratch and then look if it has something similar with the code we have.
Good thing I'm not a developer here...
Ok, I actually have something a little constructive to add (as opposed to a complaint about this still being broken). :-)   After reviewing comment 67 I am fairly confident at least something was fixed.   I always tested my code locally and the image didn't used to re-animate on reload / going through different links on the site that caused it to reload. Even though the domain / site that I first reported this bug on is gone, I still have it on my PC and tested it locally over the weekend and it did function as expected.
Hmm, 11 years and we think maybe it's off the radar? :)  Anyway, when I test in 20, reloading the non-http image doesn't do anything (e.g., the ftp one from the bug URL).  In 23, the first reload does animate it again, but the subsequent reloads do not.
We are planning on doing off main thread image animation (bug 717872); this, as well as bug 332973 would be something we'd consider when designing the solution for that.  Joe is already CC-ed on both bugs and most likely the person that's going to work on it.
Blocks: omtagif
Flags: needinfo?(milan)
No longer blocks: omtagif
I just did my own testing and at least working from a local copy on my C drive, this appears to be fixed!
(In reply to Mark Zelden from comment #75)
> I just did my own testing and at least working from a local copy on my C
> drive, this appears to be fixed!

When using the test URL provided for this bug ( http://ftp.uniovi.es/gifanim/gifanim2.gif ) the behavior is still the same for me on Firefox 30 (Aurora).  Did you test with that URL?

First load works, reload works, subsequent reloads do not. (as described in comment 72)
Darn... No I tested on a local copy of the web site I originally posted about (that site is gone now).  It has an animated gif in a frame on each page / link you select.  It animates each time now and also if you hit reload of the entire thing or an individual frame.  

I just loaded the site back out as a separate directory on my own domain and tested and it doesn't work when being served over HTTP.   :-(
I see this bug also at some https images, e.g. in this Google doodle:
https://www.google.com/doodles/maria-gaetana-agnesis-296th-birthday
Some sites probably allow caching even for https sources.
Another example of this bug can be seen with today's Astronomy Picture of the Day:
 http://apod.nasa.gov/apod/ap141202.html
The gif loops 4 times then stops, and reloading will not restart it.

A workaround for users: (1) bring up web history (by "Show all history" or ctrl-H or ctrl-shift-H), (2) right-click on the URL of the page with the animated gif, and (3) "Forget about this site".  Upon reloading the page, the gif will play again.
Handling technical details like how to restart animated GIF loops shouldn't be something a user is supposed to deal with.

Firefox should automatically re-trigger GIF loop animation on page load and image load. Period.
When using the test URL provided for this bug ( http://ftp.uniovi.es/gifanim/gifanim2.gif ) the behavior is still the same for me on Firefox 42.

First load workds, reload doesn't work, only shift+reload works.
In Firefox 43, the bug is still present.
Reload of the pic with JS has the same effect (no animation).
I did a little JSFiddle to demonstrate the problem with animated gif changed by JS.
https://jsfiddle.net/2fra6yth/
What annoys me the most is, that this bug only occurs in firefox.
Even IE10 can handle the gif animation correctly and Chrome also has no problems with the starting of the animation of a gif that has been reloaded.
What annoys me the most is that nobody responds to this bug. Surely, integrating yet another notification API is more important. As well as breaking perfectly working fontconfig support One More Time.
Just another small comment for anyone who wants to look into this bug.
On the current Firefox ESR Release (I tested with 38.5.2 and 38.6) it works without a problem, the bug is not reproducible.

Maybe someone can find out the reason by comparing the gif animation routine from the current release (where gif animation is broken) and the ESR release (where it works like a charm)
This is nontrivial to fix because of the simultaneous requirement that different instances of the same GIF are supposed to share the same timeline, even across documents (since for example they may be visible on the same page within different <iframe>s). The way the image cache is implemented currently makes it very hard to solve these problems at the same time.

However, we are about to embark on a total rewrite of how animate images work in Gecko, and this is something that we should take into consideration during that rewrite. The metabug for that work is bug 1257388, so I'll go ahead and make it block this bug. Hopefully we can (finally) get this fixed.
Depends on: 1257388
(In reply to Cajon from comment #86)
> Just another small comment for anyone who wants to look into this bug.
> On the current Firefox ESR Release (I tested with 38.5.2 and 38.6) it works
> without a problem, the bug is not reproducible.
> 
> Maybe someone can find out the reason by comparing the gif animation routine
> from the current release (where gif animation is broken) and the ESR release
> (where it works like a charm)

That unfortunately sounds more like a bug (that was fixed because it caused other issues) than like a real fix, which would require some pretty fundamental changes.
Whiteboard: [gfx-noted]
Wow Bug was reportet 12 Jears ago and still there on Win10 with FF 48.0 Good to have a work around for the next 12 years. All the other browsers are doing well:  onmouseover="javascript:document.images['bild'].src=image.gif?rand='+d.getTime();"
Scince HTML5 its also possible to use the <video> element for FF: 

 <video width="32" height="24" autoplay>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
Testcase from Comment 35 still reproduces this bug.
Well <video> seems buggy as well: https://bugzilla.mozilla.org/show_bug.cgi?id=1292457
I am still able to reproduce this bug with background-image on Version 62.0.3 (64-bit) on Windows 10 using the image from Comment 35.  https://jsfiddle.net/6h3catpL/6/

<style>
#bar {
  width: 200px;
  height: 200px;
  background-image: url(https://bugzilla.mozilla.org/attachment.cgi?id=374193);
}
</style>
<div id="bar">
</div>

If I call location.reload(), the animation will restart.  If I delete and recreate (or add another copy of #bar), the animation doesn't restart.  If I navigate away from and then go back to the page, the animation doesn't restart.

Both Safari and Chrome will restart the animation when I navigate back to the page, and Safari will restart the animation when I recreate the element.


A real-world example of the issue is at https://gaming.stackexchange.com.  The spaceship on the right side of the header is a non-looping animated GIF with a 5 second delay.  On Safari and Chrome, it will fire every time a user navigates to a page, either through a click or history event.  On Firefox, it fires only on the initial page load and refresh.
I find this really fascinating that most of the bugs I’m subscribed to at various project’s Bugzillas are the bugs which barely see any activity other than adding or removing CCs.
+1

Yet, to speak up in favour of Firefox: It's free. So we shouldn't have any false expectations here. We spent nothing so we cannot claim.

This appears to be happening with any animated image format.

Here's an example APNG:
https://benimation.nl/bugs/ff-129986/apng.png

Here's an example animated WebP:
https://benimation.nl/bugs/ff-129986/webp.webp

Severity: normal → S3

The severity field for this bug is relatively low, S3. However, the bug has 16 duplicates, 31 votes and 58 CCs.
:aosmond, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(aosmond)

The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.

Flags: needinfo?(aosmond)

This... continues to be an issue. My test case is https://explosm.net/comics/pepto-bismol and clicking Refresh, pressing F5, clicking the address bar and pressing Enter... don't cause the comic animation to play again.

Ctrl F5 correctly replays the comic animation though.

Blocks: 1869444
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: