why IE will only let you save as BMP


Sometimes you go to save an image from a web page and the only option available to you is BMP, even though the image is obviously not a BMP. People often wonder why, so I will tell you.



For whatever reason (perf, architectural simplicity, I dunno) the designers of mshtml decided to keep images around in memory as BMPs. When you go to save an image in IE, the first thing we do is check to see if the image is in the cache. If the image is not in the cache, the only representation we have of the image (without downloading it again) is mshtml’s internal representation, which is a BMP. Mostly people see this when their cache is full. The easiest way to fix this is to clear your cache. Another symptom of this is nothing happens when you View->Source on a web page.

Comments (44)

  1. Siew Moi Khor says:

    Useful tip, thanks. Came to know of your blog because Peter Torr mentioned it.

  2. Peter Torr says:

    The fact that View -> Source doesn’t work (and doesn’t even give you an error message!) when your cache is full is pretty stupid :-( I had this very error just the other day…

  3. Luke says:

    This also happens when the image url is part of a cgi-request, often seen with images linked from fark.com. Fark uses a url redirection cgi script that redirects you to the real page. For example, http://go.fark.com/cgi/fark/go.pl?IDLink=758110&location=http://www.juneauempire.com/images/121603/PostOffice.jpg
    If you try to save the image, it’s bmp only, but if you reload the page again, you can save it as jpg.

  4. Edward says:

    Ok, so why does the cache get filled up so easily?

    Mine is set to use 950Mb, but I still can’t save images at the moment.

    Doesn’t the cache ever delete anything automatically? Couldn’t it delete any file I havn’t access in the last month, or the last week. Why doesn’t it delete the oldest file to make room for the newest one?

    When I try to empty the cache Tools -> Internet Options -> Delete Files it takes about 5 minutes and locks the browser window up for ages.

  5. Justin says:

    Shouldn’t we fix it in SP2 then? 😛

  6. Daniel says:

    It also seems to happen if an image is linked without its extension. E.g., if you have an image foo.jpg, but it’s linked to as http://www.blah.com/images/foo, then when you try to save it, it ends up as a bmp.

  7. Dimitri Glazkov says:

    Actually, this (BMP save as and View->Source "nothinghappenness") only seems to only happen on the computers with larger drives, say over 60Gb. My guess is that because cache size is allocated as a percentage of the available disk space, IE bites off a little more cache than it can chew and, as a result, fails to remain in control of the cache once it reaches certain mass (I am trying to be very generic here — this is a guess). If you manually set the size of your cache to something more reasonable, like 90Mb, you should never encounter this problem.

  8. Justin says:

    There’s no time like the present to fix this bug (aka SP2). :)

  9. gentoo says:

    >> For whatever reason (perf, architectural simplicity, I dunno) the designers of mshtml decided to keep images around in memory as BMPs.

    The images are probably kept in memory as a DIB because that’s what you need to draw an image on Windows. You wouldn’t want to convert the image from JPG or GIF every time you need to display it. It would take too long.

    >>When you go to save an image in IE, the first thing we do is check to see if the image is in the cache.

    Yup.

    >> If the image is not in the cache, the only representation we haveof the image (without downloading it again) is mshtml’s internal representation, which is a BMP.

    It’s a DIB in memory. MSHTML stores the DIB as a BMP.

    >> Mostly people see this when their cache is full.

    The cache works like, well, a cache. A cache keeps the recent stuff and throws out the old stuff. If the images for recent pages are not in the cache, it’s not because the cache is full.

    >> The easiest way to fix this is to clear your cache.

    Have you tried this?

    >> Another symptom of this is nothing happens when you View->Source on a web page.

    The real reason that the image is not cached is that the the server sent cache control headers saying not to cache the image. If the server is telling the browser not to cache images, it’s also probably telling it not to cache the page.

    Online banking sites are very concerned about this sort of thing.

  10. KS says:

    Gentoo: So, why does it then work for many people to clear the cache? And why does it happen *always* once it started? There *are* certain circumstances, already mentioned here in the comments, where this symptom also occurs. Another one is when using user:password@domain syntax to log in. But these are not the same!

    Dimitri Glazkov: Could indeed be at the source of the problem. I have *never* encountered it on any machine, but have seen many complaints in the newsgroups about it. I don’t have drives over 50 GB and I usually set the cache to 50 – 100 MB on each machine.

    There is another caching bug. The IE history and caching seems to work different depending on if you are using a proxy or not. Visit some pages and then use the history (Back and Forward) buttons to walk thru them. If you don’t use a proxy it checks each page for a newer version and reloads it if so. That makes it considerably slower. If you drop the network connection you’ll get the famous "cannot find …" page. However, if you are using a proxy, you can drop the connection, et voilà, the page will come up instantly from the cache. Of course, same thing happens if you keep the network connection, it grabs the page from the cache instantly. It’s just for proving that it’s not the local proxy delivering the page so fast that you don’t notice the difference.

    Why am I telling this? Because I think this could have a connection to the bmp/no source issue as well.

    Jeff: It’s a very well known bug and I don’t see any reason why IE couldn’t detect the problem itself and fix it. So, why doesn’t it?

  11. Anonymous says:

    That gentoo guy is right about one thing. The IE cache is supposed to toss out old data and replace it with new. Something’s not working as expected.

    Dmitry is might be on to the reason for the unexpected behavior. If IE uses a 32 bit integer to keep track of the size of the cache, then IE will get confused when the cache goes over 2 GB (signed integer) or 4 GB (unsigned integer). Disks are much larger now than they were back in the mid-nineties when the IE got it’s start. It’s easy to believe that they made a mistake like this.

  12. Heiko Hebig says:

    For all I know from using IE for many years is this BMP issue has been around since early versions of IE and it happens across Win98, WinNT, 2000

    It happens on small and large HDs, so I doubt that large HDs are of any issue in this context.

  13. Scott Foerster says:

    same machine, logging on as administrator, default save as is jpg, log on as a regular (power) user, will only allow saving as bmp. .. playing around with the cache does not solve the problem

  14. jason says:

    it’s my guess that when the cache is full, IE stops storing information

    [when i right click>properties an image the file type it’s not available]

    [when i reaload a page full of images [jpg’s gif’s] IE donwloads the images again, as opposed to just refresh the contents already stored in the cache ]

    i usually solve this by cleaning up the cache but that’s time consuming, annoying and i must do it on regular basis.

    i hope someone founds a cure for this.

  15. josh says:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;810978

    I had this problem, and the solution in the above knowledge base article fixed it.

    – Josh

  16. appyaardvark says:

    All that said, a way to get round it is to right click on the image and choose properties, copy the URL of the image and download with a download manager. It’s a bit more time consuming, but if it’s a gif you really would like it’s nice trick 😉

  17. ulrich says:

    i agree with the big disk theory, bmp save behaviour started when i connected a 160gb usb2 disk to my laptop.

  18. Neckaros says:

    I know how to fix it:

    Use FireFox or Opera…

  19. basam says:

    clearing the cache did it for me. thanks!

  20. Nick says:

    Thanks heaps Jeff! it works after I did the steps in the site. Guys, in case you didn’t see this post, here it is:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;810978“>http://support.microsoft.com/default.aspx?scid=kb;en-us;810978

    quoting:

    ># re: why IE will only let you save as BMP

    > http://support.microsoft.com/default.aspx?scid=kb;en-us;810978“>http://support.microsoft.com/default.aspx?scid=kb;en-us;810978

    >

    >I had this problem, and the solution in the above knowledge base article fixed it.

    >

    >- Josh

  21. Sean says:

    I am not a programmer, but I have to ask. It is reasonable for IE to look in the cache to obtain the image in its original form. It isn’t reasonable for the cache to "fill up." Isn’t it supposed to automatically remove the old content to make room? This is why MS is so frustrating–how do you decide which bugs to fix???

  22. jeffdav says:

    Sean: The process for deciding which bugs to fix is oddly complex. It is a balance of customer feedback, internal partners, prioritization, severity, etc. The reason why I do not fix it personally is because others own that component. I do not know the code well, I do not understand their design decisions, I do not have the context required to make sure legacy stuff does not break, etc.

  23. Sean says:

    Thanks, I appreciate your response!

    I wasn’t blaming you personally. I was blaming Microsoft.

    This is a really common problem. If you search groups.google.com, it is frequently reported by that subset of users who are sophisticated enough to figure out NNTP.

    "Normal" users, like my mom, are not going to discover newsgroups, let alone stumble on the "solution" of emptying the cache. Come to think of it, they probably won’t even realize there is a difference between JPEG and BMP :)

    Anyway, the thing that ‘bugs’ me (pun intended) is that this is just a flaw in the cache feature, and it should be straightforward to fix, but it feels like MS just doesn’t care.

    Thanks for listening! Sean.

  24. Lynn Ava says:

    Both using information on this link: http://support.microsoft.com/default.aspx?scid=kb;en-us;810978 (Thanks Josh!) and using download manager worked for me, but the first was a permanent solution to a temporary problem (unless it happens again…)

    It’s a good idea to clear the cache either way anyhow, eh?

  25. Judy says:

    Regarding the "View Source" problem with IE6 on XP. I’ve tried emptying cache, increasing the size, uninstalling, reinstalling, hot reboot, cold start, just about everything I’ve been able to think of or find and "View | Source" still does not work. Does anyone have any other ideas? (ver 6.0.2800) Thanks! Judy (If e-mail, Subject: "IE SOURCE" HeyJude@houston.rr.com)

  26. jeffdav says:

    Aparently clearing the cache does not always fix the problem…

  27. Judy says:

    It’s Judy again. I just found the answer to this problem if anyone else needs it. I had placed a shortcut to Notepad.exe on my desktop. I was directed to remove any notepad.exe files from the desktop (C:Documents and SettingsAll UsersDesktop or C:Documents and Settings<Your user profile>Desktop.) It worked!! Thanks for replying Jeff!

    Judy

  28. doug says:

    another fix

    click on tools then internet options

    under temporary internet files click on settings

    make sure automaticly is selected

    This fixed my problem of my cache never clearing itself.

    I had the first circle selected.

  29. Rott says:

    I have tried all the suggestions from microsoft and yourselves to try and solve the problem…. but it is still only saving jpegs in bmp format :(

  30. Moe says:

    I too have tried every solution ever listed (even some pretty dumb ones) to no avail. I consider myself extremely computer-literate and am running XP Pro and constantly updated "fixes". Note: never had the problem until recently on this 2-year old machine with no changes in hardware/software except I was stupid enough to ignore all the comments about not upgrading to IE 6 when it came out and did so, but even that was a long time ago. What upsets me most is that Microsoft has known about this problem for years and refuses to address it. Someday they’ll realize it’s all these small things (in their eyes) that push us to Linux or other solutions. I’m almost there myself, and when I get there, the over 400 users I affect will also be switched over.

  31. BayouGirl says:

    I tried the steps in the Microsoft Knowledge Article to fix this on my computer. I had one damaged file under View Objects, but removing that did not solve the problem. As per the article, I began removing the other (undamaged) files from under View Objects, one by one, to see if I could find something there that was causing the problem for me. After I removed the HouseCall control from Trend Micro’s online free virus scanner, my problem was solved! Thanks so much to the person that posted the article on this!

  32. Ed Neville says:

    This condition is also caused by a variant file left within known as "SASCLH"

    which is not removed in any "saser" virus removal proceedures.

    Removing this file will solve the BMP only problem.

    Good Luck, Ed

  33. Nosfe says:

    For those that clearing cache didn’t work, like me.

    After reading all this, I tried again and… I realized

    that removing the cache manually doesn’t work.

    You must do it using Tools->Internet options, etc..

    It seems doing like that, clears also some internal

    checks about cache size or anything else…

    Now I can save as original format and use view source..

    God how I missed it….