diff --git a/samples/image/image.cpp b/samples/image/image.cpp index d2e2924524..9fa7e32efe 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -423,7 +423,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, yH = 2420 + image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ; } - m_ani_images = wxImage::GetImageCount ( dir + _T("horse.ani"), wxBITMAP_TYPE_ANI ); + m_ani_images = wxImage::GetImageCount ( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI ); if (m_ani_images==0) wxLogError(wxT("No ANI-format images found")); else @@ -432,7 +432,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, for (i=0; i < m_ani_images; i++) { image.Destroy(); - if (!image.LoadFile( dir + _T("horse.ani"), wxBITMAP_TYPE_ANI, i )) + if (!image.LoadFile( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI, i )) { wxString tmp = wxT("Can't load image number "); tmp << i ; diff --git a/src/common/image.cpp b/src/common/image.cpp index 08b7f9c4d8..f009a4c6fb 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -1005,7 +1005,10 @@ int wxImage::GetImageCount( const wxString &name, long type ) { #if wxUSE_STREAMS wxFileInputStream stream(name); - return GetImageCount(stream, type); + if (!stream.Ok()) + return 0; + else + return GetImageCount(stream, type); #else return 0; #endif