// Name: gifdecod.cpp
// Purpose: wxGIFDecoder, GIF reader for wxImage and wxAnimation
// Author: Guillermo Rodriguez Garcia <guille@iies.es>
-// Version: 3.02
-// Last rev: 1999/08/18
+// Version: 3.03
+// RCS-ID:
// Copyright: (c) Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#endif
#ifndef WX_PRECOMP
-# include "wx/setup.h"
+# include "wx/defs.h"
#endif
-#if wxUSE_STREAMS
+#if wxUSE_STREAMS && wxUSE_GIF
#include <stdlib.h>
#include <string.h>
-#include "wx/defs.h"
#include "wx/gifdecod.h"
bool wxGIFDecoder::CanRead()
{
unsigned char buf[3];
+ off_t pos;
+ pos = m_f->TellI();
m_f->SeekI(0, wxFromStart);
m_f->Read(buf, 3);
+ m_f->SeekI(pos, wxFromStart);
return (memcmp(buf, "GIF", 3) == 0);
}
/* This line should not be neccessary!
* Some images are not loaded correctly
* without it. A bug in wxStream?
+ * Yes. Fixed now.
*/
// m_f->SeekI(m_f->TellI(), wxFromStart);
+
m_f->SeekI(i, wxFromCurrent);
}
}
return E_OK;
}
-#endif // wxUSE_STREAM
+#endif // wxUSE_STREAMS && wxUSE_GIF