When asked to open an incomplete image, Firefox decodes as much as it can and displays the results; Safari shows a broken image icon. I think WebCore should only refuse to display the image if nothing can be decoded at all (couldn't connect to server, etc.), or perhaps if the decoder sets m_failed to true (indicating an undecodable image). For images where the decoder happily decodes as much as it can and we simply never have enough data to transition to FrameComplete, it seems better to show the partial image than nothing. Test image to be attached shortly.
Created attachment 16011 [details] Incomplete BMP This is a BMP file with the last 100 bytes trimmed off.
In my testing, incomplete JPEGs are displayed. I think behavior may depend on the platform's image decoding capabilities.
Hmm. This may be specific to BMPs. Tested on Safari 3 for Windows. Certainly if the image decoder doesn't mark the frame status as FramePartial until it's done, we won't have this issue. And regardless, things will work fine while the image is still being transmitted - this only refers to the behavior once "receivedAllData" is true.
Confirmed problem also on Leopard. Opera also displays the test picture as well as Firefox.
This still reproduces in Safari/Win 4.0.5. It does not reproduce in Chromium as I have made the open-source BMPImage* decoder classes behave like Fx/Opera/IE. (I forget whether I did this pre- or -post-filing this bug.)
I believe Mark has done some work on image decoding in the past few months.
<rdar://problem/96898074>
This continues to be an issue in Safari 15.