]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagjpeg.cpp
Added support for item clicks
[wxWidgets.git] / src / common / imagjpeg.cpp
index 0b89c5c3ec2c0234718d03163cf2c606f1e5c21b..b2e4447a024f58272d3c88b5d560e71246b44aa9 100644 (file)
@@ -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