Fixed CanRead(), which incorrectly forced version 89a, thus preventing
valid GIFs with older version numbers (87a) to be loaded correctly. Also, CanRead() is now in gifdecod.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We don't put pragma implement in this file because it is already present in
|
We don't put pragma implement in this file because it is already present in
|
||||||
src/common/image.cpp
|
src/common/image.cpp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
@@ -24,7 +24,6 @@ src/common/image.cpp
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/image.h"
|
#include "wx/image.h"
|
||||||
// #include "wx/imaggif.h"
|
|
||||||
#include "wx/gifdecod.h"
|
#include "wx/gifdecod.h"
|
||||||
#include "wx/wfstream.h"
|
#include "wx/wfstream.h"
|
||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
@@ -68,11 +67,14 @@ bool wxGIFHandler::SaveFile( wxImage * WXUNUSED(image),
|
|||||||
|
|
||||||
bool wxGIFHandler::CanRead( wxInputStream& stream )
|
bool wxGIFHandler::CanRead( wxInputStream& stream )
|
||||||
{
|
{
|
||||||
unsigned char hdr[5];
|
wxGIFDecoder *decod;
|
||||||
|
bool ok;
|
||||||
stream.Read(&hdr, 5);
|
|
||||||
stream.SeekI(-5, wxFromCurrent);
|
decod = new wxGIFDecoder(&stream);
|
||||||
return (hdr[0] == 'G' && hdr[1] == 'I' && hdr[2] == 'F' && hdr[3] == '8' && hdr[4] == '9');
|
ok = decod->CanRead();
|
||||||
|
|
||||||
|
delete decod;
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user