X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/deb2fec01e097102e2799d7d0797f66dbae4f0c4..3995f8eb97f3fa807fb7d805bb8b86425f490b06:/src/common/imagjpeg.cpp 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