implement GetImageCount() for GIF handler (closes #10663); added test for it to the sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-04-05 12:52:22 +00:00
parent 3b8ec767b9
commit 85fcb94fc9
5 changed files with 58 additions and 23 deletions

View 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