Skip to content

When disk is full ,imwrite will return true,not false.And no Exception.. #25969

@feelingseas

Description

@feelingseas

System Information

opencv version :4.4.0
win10

Detailed description

cv::Mat m = cv::imread("H:\\k.bmp");
if(m.empty()){
	return;
}
// disk D is full.
bool res = cv::imwrite("D:\k2.bmp",m);
if(res){
	//always come here... true
}
else{
	//will not come here
}

The file k2.bmp is created ,but the file size is 0.of course ,k2.bmp file is broken.
I searched many ,but I didn't find the answer.

Steps to reproduce

just let one of your disk be full.

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions