X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/deb2fec01e097102e2799d7d0797f66dbae4f0c4..b70ababc146a97e9f1b2afc0193f92fa6c202dd9:/src/common/imagbmp.cpp diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index db3f1e2b40..005e007dfa 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -401,6 +401,15 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE return TRUE; } +bool wxBMPHandler::CanRead( wxInputStream& stream ) +{ + unsigned char hdr[2]; + + stream.Read(&hdr, 2); + stream.SeekI(-2, wxFromCurrent); + return (hdr[0] == 'B' && hdr[1] == 'M'); +} + #endif // wxUSE_STREAMS