X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8a68d8b6c13323ad187062b0be009f6d22af77f0..1c383dbac927bbcc728365b2f8894a5ce676b19b:/src/common/imaggif.cpp?ds=sidebyside diff --git a/src/common/imaggif.cpp b/src/common/imaggif.cpp index f719a2ad41..b15fff887e 100644 --- a/src/common/imaggif.cpp +++ b/src/common/imaggif.cpp @@ -3,6 +3,7 @@ // Purpose: wxGIFHandler // Author: Vaclav Slavik & Guillermo Rodriguez Garcia // RCS-ID: $Id$ +// Copyright: (c) 1999 Vaclav Slavik & Guillermo Rodriguez Garcia // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -12,7 +13,7 @@ */ // For compilers that support precompilation, includes "wx.h". -#include +#include "wx/wxprec.h" #ifdef __BORLANDC__ # pragma hdrstop @@ -22,36 +23,42 @@ # include "wx/defs.h" #endif -#if 1 // change this to #if wxUSE_GIF +#if wxUSE_GIF #include "wx/image.h" #include "wx/gifdecod.h" #include "wx/wfstream.h" -#include "wx/module.h" #include "wx/log.h" #if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler,wxImageHandler) #endif -#if wxUSE_STREAMS - //----------------------------------------------------------------------------- // wxGIFHandler //----------------------------------------------------------------------------- +#if wxUSE_STREAMS + bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose ) { wxGIFDecoder *decod; + int error; bool ok; decod = new wxGIFDecoder(&stream, TRUE); - - if (decod->ReadGIF() != E_OK) + + if ((error = decod->ReadGIF()) != E_OK) { if (verbose) - wxLogDebug(_T("Error reading GIF")); - + { + switch (error) + { + case E_FORMATO: wxLogError(wxT("wxGIFHandler: error in image format")); break; + case E_MEMORIA: wxLogError(wxT("wxGIFHandler: couldn't allocate memory")); break; + default: wxLogError(wxT("wxGIFHandler: unknown error !!!")); + } + } delete decod; return FALSE; } @@ -67,12 +74,12 @@ bool wxGIFHandler::SaveFile( wxImage * WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose ) { if (verbose) - wxLogDebug(_T("wxGIFHandler is read-only!!")); + wxLogDebug(wxT("wxGIFHandler is read-only!!")); return FALSE; } -bool wxGIFHandler::CanRead( wxInputStream& stream ) +bool wxGIFHandler::DoCanRead( wxInputStream& stream ) { wxGIFDecoder *decod; bool ok; @@ -84,8 +91,6 @@ bool wxGIFHandler::CanRead( wxInputStream& stream ) return ok; } -#endif - // wxUSE_STREAMS +#endif // wxUSE_STREAMS -#endif - // wxUSE_GIF +#endif // wxUSE_GIF