X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/deb2fec01e097102e2799d7d0797f66dbae4f0c4..91f491639e8b7a034704a2e1cfc15129783e9b56:/src/common/imagjpeg.cpp?ds=inline diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp index 0b89c5c3ec..b2e4447a02 100644 --- a/src/common/imagjpeg.cpp +++ b/src/common/imagjpeg.cpp @@ -310,11 +310,19 @@ bool wxJPEGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo return TRUE; } -#endif - // wxUSE_STREAMS -#endif - // wxUSE_LIBJPEG +bool wxJPEGHandler::CanRead( wxInputStream& stream ) +{ + unsigned char hdr[2]; + + stream.Read(&hdr, 2); + stream.SeekI(-2, wxFromCurrent); + return (hdr[0] == 0xFF && hdr[1] == 0xD8); +} + +#endif // wxUSE_STREAMS + +#endif // wxUSE_LIBJPEG