Yesterday while testing a simple hand-coded site locally I came up against the notorious error of PNGs not appearing in IE7 for Vista. A site check which should have taken a few seconds turned into another afternoon lost to a browser bug.
What’s that, you say? IE7 fixed the disappearing PNG error from IE6? IE7 enabled PNG functionality? Oh no it did-n’t, girlfriend. In IE7, PNGs can occasionally fail to appear not due to markup errors or CSS conflicts, but botched registry entries. Read on.
First, I tried two basic fixes specific to Vista:
- Disabling User Access Control (UAC), which you don’t need at all if you are the only person who uses your Vista machine. This didn’t fix it.
- Right clicking on IE and running as Administrator (although I already am Administrator) – this didn’t fix it either.
I then found this page which explained how the issue was a known problem caused by the registry. Some other software installation (it could have been anything) altered the file class and MIME settings for the PNG file type, which causes them to disappear in IE7, but not in anything else, of course. The author of that page provided an easy .reg merge file which would reset the settings for .PNGs, hopefully solving the problem. Based on the comments left on his page, it looks like it worked for a lot of people.
But not for me. When I tried to merge his registry file, I got the error message stating that “Not all data was successfully written to the registry. Some keys are open by the system or other processes.” Someone on his page suggested breaking the merged .reg file into fifteen individual .reg files, merging them individually, and then researching fixing the ownership issues with the ones that were causing open keys…the mere thought of that had me losing the will to live, so I had to find another solution.
Another suggested solution was to run regsvr32 %WinDir%\system32\pngfilt.dll in the command prompt. This promised to re-set the png functionality from Vista’s source files, and as with the fix described above, it seems to work for some. But when I tried this, I got yet another error message: “The module C:\Windows\system32\pngfilt.dll was loaded but the entry-point dllregisterserver was not found. Make sure that C:\Windows\system32\pngfilt.dll is a valid DLL or OCX file and then try again.” A colleague suggested using the System File Checker to repair that file from the Vista DVD. Which would have been great if I had gotten a Vista DVD with this laptop. But mine only came with the option to create a recovery or restoration CD, which would not fix that corrupt file.
So on to trying to change the file associations on the surface. One suggestion which does seem to work for some people experiencing this problem was to right click on a PNG file, select Open With –> Choose Default Program –> Windows Photo Gallery. Works for some, but not for me.
Finally, someone on LinkedIn pointed me to a discussion on Apple’s forums which provided the fix that worked. The culprit seemed to be Quicktime, of all things. Some suggested removing Quicktime altogether, but then iTunes wouldn’t work, and I’d break out in hives and start twitching. So barring a full uninstall of Quicktime, according to that discussion on Apple’s forums, here is the solution to the PNG bug:
- In Quicktime, open and edit both QuickTime and Players preferences (edit, preferences) and disable everything you possibly can.
- Right click on a PNG file, Open With –> Choose Default Program –> Internet Explorer.
- Close IE, then load a PNG from the web via Internet Explorer. It’s there? Good. Close IE.
- Right click on a PNG file, Open With –> Choose Default Program –> Windows Photo Gallery.
Sorted! PNGs appear in IE7 again.
It’s hard to believe that this far along in the web design journey, we still have to re-train our browsers to recognise basic file types. It’s harder still to believe that the fix to this problem almost involved de-merging registry files, digging out a nonexistent install DVD, and re-writing system-generated registry users. All this hassle to get a tiny handful of graphics to appear on a simple site. And they wonder why most of us would rather drink cold decaf coffee than give up Firefox?
Given how frequently Quicktime is refreshed, I have no doubt that this problem will reappear down the road. At least I know how to fix it now – but that’s because I was aware of the problem and knew what I was looking for. What about average web users who don’t know what a PNG is and will only be seeing a blank space where a graphic should be? Could they navigate through the steps above? No, and they shouldn’t have to, and to that end Microsoft needs to patch this error as soon as possible.