Today I found very strange problem with Internet Explorer. I’ve generated GIF-image with PHP GD2 and sent results for client browser. In IE I’ve tried to store picture in my local file system but the only option was to save the picture as a .BMP file instead of as a native .gif file! The same problem is described in Microsoft Knowledge Base, but it does not help me.
Then I start playing with PHP and headers and discover very nice gizmo: bug became apparent only when my PHP-script uses session_start(). But I needed sessions! Solution was very simple: it was necessary to add following lines before image output:
These lines will clear all headers sent by session_start() function and IE will understand that your the image is in right format.