return false;
}
- return handler->LoadFile(this, stream, true/*verbose*/, index);
+ if (!handler->CanRead(stream))
+ {
+ wxLogError(_("Image file is not of type %d."), type);
+ return false;
+ }
+ else
+ return handler->LoadFile(this, stream, true/*verbose*/, index);
}
bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype, int index )
return false;
}
- return handler->LoadFile( this, stream, true/*verbose*/, index );
+ if (!handler->CanRead(stream))
+ {
+ wxLogError(_("Image file is not of type %s."), (const wxChar*) mimetype);
+ return false;
+ }
+ else
+ return handler->LoadFile( this, stream, true/*verbose*/, index );
}
bool wxImage::SaveFile( wxOutputStream& stream, int type ) const