]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imaggif.cpp
implement GetImageCount() for GIF handler (closes #10663); added test for it to the...
[wxWidgets.git] / src / common / imaggif.cpp
index 22a8dc04cca7c1ec2b2172f9a26a0c874510faaf..7b241bd6e19ac143aa056601b4d0b91803db9286 100644 (file)
@@ -100,6 +100,16 @@ bool wxGIFHandler::DoCanRead( wxInputStream& stream )
     return decod.CanRead(stream);
 }
 
+int wxGIFHandler::GetImageCount( wxInputStream& stream )
+{
+    wxGIFDecoder decod;
+    wxGIFErrorCode error = decod.LoadGIF(stream);
+    if ( (error != wxGIF_OK) && (error != wxGIF_TRUNCATED) )
+        return -1;
+
+    return decod.GetFrameCount();
+}
+
 #endif  // wxUSE_STREAMS
 
 #endif  // wxUSE_GIF