]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagpng.cpp
Added wxFontEnumerator class for wxMSW, and fixed text validator for French
[wxWidgets.git] / src / common / imagpng.cpp
index 1a27982b129883f96f860bfce63de5d2fd12f2c0..7609aae068ee107642818e0f51ef706f37a9739d 100644 (file)
@@ -346,6 +346,15 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
     return TRUE;
 }
 
+bool wxPNGHandler::CanRead( wxInputStream& stream )
+{
+    unsigned char hdr[4];
+    
+    stream.Read(&hdr, 4);    
+    stream.SeekI(-4, wxFromCurrent);
+    return (hdr[0] == 0x89 && hdr[1] == 'P' && hdr[2] == 'N' && hdr[3] == 'G');
+}
+
 #endif
   // wxUSE_STREAMS