- Create Account

PNGs randomly disappear when I refresh a page

Forums > IEPNGFix > PNGs randomly disappear when I refresh a page
Author
Message

1) daGUY Group: Guests
IP: 207.19.--.--
I have a page that makes use of lots of 16 x 16 PNG icons - 52, to be exact. When I load the page off my server in IE, randomly only 13 of them will display (the same 13 each time). If I refresh the page, sometimes they'll all show up, and sometimes just the 13 will. There doesn't seem to be any rhyme or reason as to what causes the difference. I can just sit there and keep refreshing the page, and they'll disappear and reappear at random on each load.

If I view the source of the page when the PNGs aren't showing, the code for them is still there. This should be expected since I'm not changing the code at all - all I'm doing is refreshing the page.

This does not happen when I view the page in IE on my local computer - only when I look at it on the server. I've used iepngfix.htc before and never had this problem. The only thing I can think of is that it has something to do with the number of PNGs and/or the amount of time it takes to download them all from the server...?

2) daGUY Group: Guests
IP: 207.19.--.--
Edit - upon further inspection, this DOES also happen when I look at the page locally, in addition to on the server. I suppose that then rules out download time as a factor...

I did make one possibly significant discovery - the 13 that always appear are background images, while the ones that disappear at random are inline. Hmm...

3) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 118.92.--.--
Hmm, odd. You do have blank.gif in the right place? And is this with v1.0RC4 or RC5?

Either way having a million PNGs can be pretty slow. You sure you don't want to just serve up some GIFs to IE6 instead?

- Angus.

4) daGUY Group: Guests
IP: 207.19.--.--
Thanks for the reply!

I was using RC4 but I tried RC5 and still have the same problem. And blank.gif is definitely in the right spot since in IE you get the little red X icon if it can't find the image (I tried breaking the path intentionally just to make sure).

Unfortunately I can't really use GIFs...in some cases the icons are against a solid background, but in other spots they're against a gradient background or an image. In the case of this particular page, they're against a gradient background, of course...haha.

5) daGUY Group: Guests
IP: 207.19.--.--
Forgot to mention - I think it might be some kind of caching issue. When I load the page "from scratch" (meaning I type the URL in directly), the icons always come up. But if I navigate to it from a link on another page (or by using the forward/back buttons) that's when they seem to disappear (but again, not 100% of the time).

In my first post, I wrote that I could keep refreshing the page and the icons would appear and disappear. I may have misspoke as I can't seem to make that happen at all now (using RC4 or RC5). Either I'm going crazy or for whatever reason it's no longer doing that. Odd.

6) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Well, time seems to have fixed the issue then I hope :).

-  Angus.

7) daGUY Group: Guests
IP: 207.19.--.--
Well, scratch that...I got them to start disappearing and reappearing again just by refreshing the page. Haha.

I also just noticed the problem on a second page in which 10 inline PNGs disappeared, while 2 remained. This page has 33 PNGs total.

So far, there are only two things that have proven consistent:

- The problem only occurs on pages with a high number of PNGs (although I don't know precisely what "high" is)

- Inline PNGs are the only ones that will disappear (although, not necessarily every single one on the page will do so). PNGs set as background images do not disappear

I'm stumped!

8) daGUY Group: Guests
IP: 207.19.--.--
Got it! All of the icons that were disappearing lacked dimensions. So I added width and height to just one of the disappearing icons. That icon no longer disappeared (even when the other ones around it did), which proved that having the dimensions specified made the difference.

So that solves it, but what's weird is that not EVERY icon without dimensions will disappear. I still don't understand why not...?

9) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Great :). Yes, giving images dimensions is generally a very good idea with this script.

- Angus.

10) daGUY Group: Guests
IP: 207.19.--.--
Angus, any idea why leaving out dimensions would only affect some of the images and not all of them? And why the images without dimensions disappear at random and not 100% of the time?

I'm just curious :-)

11) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Google for "hasLayout". It's kinda complicated and the issue with this script is a little more in depth (the standard non-dimension hasLayout fixes don't completely solve it), but basically in order to reliably have the PNG filter apply to an element it should have at least one dimension applied.

The script attempts to estimate an element's size and assign that as its definite size, it usually works OK but IE6 is sometimes just random!

- Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.