If I do C-x i foo.xpm RET with point at position 0 in a buffer, the
image is inserted and displayed correctly. If point is anywhere else
in the buffer, the image insert fails. Seems like the whole contents
of the buffer are being handed to the image decoder, not just the
image data.
I noticed this at first when trying to add support for JPEG and GIF to
the native Win32 version (this works by the way), but the bug is not
Windows-specific.