mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
Add warning message to imread()
Add a warning message using CV_LOG__WARNING(). This way api behaviour is preserved. Outputs are the same but user gets an extra warning in case fopen() fails to access image file for some reason. This would help new users and also debugging complex apps which use imread() Signed-off-by: nickjackolson <metedurlu@gmail.com>
This commit is contained in:
parent
49432009fe
commit
79d4e865fe
@ -226,8 +226,10 @@ static ImageDecoder findDecoder( const String& filename ) {
|
||||
FILE* f= fopen( filename.c_str(), "rb" );
|
||||
|
||||
/// in the event of a failure, return an empty image decoder
|
||||
if( !f )
|
||||
if( !f ) {
|
||||
CV_LOG_WARNING(NULL, "imread_('" << filename << "'): can't open/read file: check file path/integrity");
|
||||
return ImageDecoder();
|
||||
}
|
||||
|
||||
// read the file signature
|
||||
String signature(maxlen, ' ');
|
||||
|
Loading…
Reference in New Issue
Block a user