X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/85fcb94fc99880e8fdb127ea1fc6cb0aefa6986d..dd71bfb9921430755a885117cc6c9843c62dafda:/src/common/imaggif.cpp diff --git a/src/common/imaggif.cpp b/src/common/imaggif.cpp index 7b241bd6e1..fdb9a4971d 100644 --- a/src/common/imaggif.cpp +++ b/src/common/imaggif.cpp @@ -89,7 +89,9 @@ bool wxGIFHandler::SaveFile( wxImage * WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose ) { if (verbose) + { wxLogDebug(wxT("GIF: the handler is read-only!!")); + } return false; } @@ -98,15 +100,19 @@ bool wxGIFHandler::DoCanRead( wxInputStream& stream ) { wxGIFDecoder decod; return decod.CanRead(stream); + // it's ok to modify the stream position here } -int wxGIFHandler::GetImageCount( wxInputStream& stream ) +int wxGIFHandler::DoGetImageCount( wxInputStream& stream ) { wxGIFDecoder decod; wxGIFErrorCode error = decod.LoadGIF(stream); if ( (error != wxGIF_OK) && (error != wxGIF_TRUNCATED) ) return -1; + // NOTE: this function modifies the current stream position but it's ok + // (see wxImageHandler::GetImageCount) + return decod.GetFrameCount(); }