git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32539
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool wxImage::SaveFile( const wxString& filename, int type ) const
{
#if wxUSE_STREAMS
bool wxImage::SaveFile( const wxString& filename, int type ) const
{
#if wxUSE_STREAMS
+ wxCHECK_MSG( Ok(), false, wxT("invalid image") );
+
((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
wxFileOutputStream stream(filename);
((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
wxFileOutputStream stream(filename);
bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype ) const
{
#if wxUSE_STREAMS
bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype ) const
{
#if wxUSE_STREAMS
+ wxCHECK_MSG( Ok(), false, wxT("invalid image") );
+
((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
wxFileOutputStream stream(filename);
((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
wxFileOutputStream stream(filename);
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
wxImageHandler *handler = FindHandler(type);
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
wxImageHandler *handler = FindHandler(type);
{
wxLogWarning( _("No image handler for type %d defined."), type );
{
wxLogWarning( _("No image handler for type %d defined."), type );
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
wxImageHandler *handler = FindHandlerMime(mimetype);
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
wxImageHandler *handler = FindHandlerMime(mimetype);
{
wxLogWarning( _("No image handler for type %s defined."), mimetype.GetData() );
{
wxLogWarning( _("No image handler for type %s defined."), mimetype.GetData() );