]>
git.saurik.com Git - wxWidgets.git/blob - src/common/imaggif.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGIFHandler
4 // Author: Vaclav Slavik & Guillermo Rodriguez Garcia
6 // Copyright: (c) 1999 Vaclav Slavik & Guillermo Rodriguez Garcia
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 We don't put pragma implement in this file because it is already present in
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
29 #include "wx/gifdecod.h"
30 #include "wx/wfstream.h"
34 #if !USE_SHARED_LIBRARIES
35 IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler
,wxImageHandler
)
38 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
44 bool wxGIFHandler::LoadFile( wxImage
*image
, wxInputStream
& stream
, bool verbose
, int WXUNUSED(index
) )
50 decod
= new wxGIFDecoder(&stream
, TRUE
);
52 if ((error
= decod
->ReadGIF()) != wxGIF_OK
)
58 case wxGIF_INVFORMAT
: wxLogError(_("wxGIFHandler: error in GIF image format")); break;
59 case wxGIF_MEMERR
: wxLogError(_("wxGIFHandler: couldn't allocate enough memory")); break;
60 default: wxLogError(_("wxGIFHandler: unknown error !!!"));
68 ok
= decod
->ConvertToImage(image
);
74 bool wxGIFHandler::SaveFile( wxImage
* WXUNUSED(image
),
75 wxOutputStream
& WXUNUSED(stream
), bool verbose
)
78 wxLogDebug(wxT("wxGIFHandler is read-only!!"));
83 bool wxGIFHandler::DoCanRead( wxInputStream
& stream
)
88 decod
= new wxGIFDecoder(&stream
);
89 ok
= decod
->CanRead();
95 #endif // wxUSE_STREAMS