]> git.saurik.com Git - wxWidgets.git/commitdiff
Only do sanity check if the stream is seekable, otherwise it'll always fail
authorJulian Smart <julian@anthemion.co.uk>
Mon, 23 Jan 2006 18:12:47 +0000 (18:12 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 23 Jan 2006 18:12:47 +0000 (18:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/image.cpp

index d261424034f36923d31e1afa658ab1164c3519df..02df26fdd920c31c18bc6770c99a1f6035211581 100644 (file)
@@ -1594,7 +1594,7 @@ bool wxImage::LoadFile( wxInputStream& stream, long type, int index )
         return false;
     }
 
-    if (!handler->CanRead(stream))
+    if (stream.IsSeekable() && !handler->CanRead(stream))
     {
         wxLogError(_("Image file is not of type %d."), type);
         return false;
@@ -1618,7 +1618,7 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype, int ind
         return false;
     }
 
-    if (!handler->CanRead(stream))
+    if (stream.IsSeekable() && !handler->CanRead(stream))
     {
         wxLogError(_("Image file is not of type %s."), (const wxChar*) mimetype);
         return false;