Added error messages when (verbose == TRUE) to know why the
load failed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
// Purpose: wxGIFHandler
|
// Purpose: wxGIFHandler
|
||||||
// Author: Vaclav Slavik & Guillermo Rodriguez Garcia
|
// Author: Vaclav Slavik & Guillermo Rodriguez Garcia
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1999 Vaclav Slavik & Guillermo Rodriguez Garcia
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -22,12 +23,11 @@
|
|||||||
# include "wx/defs.h"
|
# include "wx/defs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 // change this to #if wxUSE_GIF
|
#if 1 // change this to #if wxUSE_GIF
|
||||||
|
|
||||||
#include "wx/image.h"
|
#include "wx/image.h"
|
||||||
#include "wx/gifdecod.h"
|
#include "wx/gifdecod.h"
|
||||||
#include "wx/wfstream.h"
|
#include "wx/wfstream.h"
|
||||||
#include "wx/module.h"
|
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARIES
|
#if !USE_SHARED_LIBRARIES
|
||||||
@@ -43,15 +43,22 @@ IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler,wxImageHandler)
|
|||||||
bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose )
|
bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose )
|
||||||
{
|
{
|
||||||
wxGIFDecoder *decod;
|
wxGIFDecoder *decod;
|
||||||
|
int error;
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
decod = new wxGIFDecoder(&stream, TRUE);
|
decod = new wxGIFDecoder(&stream, TRUE);
|
||||||
|
|
||||||
if (decod->ReadGIF() != E_OK)
|
if ((error = decod->ReadGIF()) != E_OK)
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
wxLogDebug(_T("Error reading GIF"));
|
{
|
||||||
|
switch (error)
|
||||||
|
{
|
||||||
|
case E_FORMATO: wxLogError(_T("wxGIFHandler: error in image format")); break;
|
||||||
|
case E_MEMORIA: wxLogError(_T("wxGIFHandler: couldn't allocate memory")); break;
|
||||||
|
default: wxLogError(_T("wxGIFHandler: unknown error !!!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
delete decod;
|
delete decod;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user