/////////////////////////////////////////////////////////////////////////////
-// Name: image.cpp
+// Name: src/common/image.cpp
// Purpose: wxImage
// Author: Robert Roebling
// RCS-ID: $Id$
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
const double value = maximumRGB;
- double hue, saturation;
+ double hue = 0.0, saturation;
const double deltaRGB = maximumRGB - minimumRGB;
if ( wxIsNullDouble(deltaRGB) )
{
case BLUE:
hue = 4.0 + (red - green) / deltaRGB;
break;
+
+ default:
+ wxFAIL_MSG(wxT("hue not specified"));
+ break;
}
hue /= 6.0;