|
|
@ -51,6 +51,8 @@ |
|
|
|
#undef max |
|
|
|
#undef max |
|
|
|
#include <iostream> |
|
|
|
#include <iostream> |
|
|
|
#include <fstream> |
|
|
|
#include <fstream> |
|
|
|
|
|
|
|
#include <cerrno> |
|
|
|
|
|
|
|
#include <opencv2/core/utils/logger.hpp> |
|
|
|
#include <opencv2/core/utils/configuration.private.hpp> |
|
|
|
#include <opencv2/core/utils/configuration.private.hpp> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -718,6 +720,23 @@ static bool imwrite_( const String& filename, const std::vector<Mat>& img_vec, |
|
|
|
code = encoder->write( write_vec[0], params ); |
|
|
|
code = encoder->write( write_vec[0], params ); |
|
|
|
else |
|
|
|
else |
|
|
|
code = encoder->writemulti( write_vec, params ); //to be implemented
|
|
|
|
code = encoder->writemulti( write_vec, params ); //to be implemented
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!code) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
FILE* f = fopen( filename.c_str(), "wb" ); |
|
|
|
|
|
|
|
if ( !f ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (errno == EACCES) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
CV_LOG_WARNING(NULL, "imwrite_('" << filename << "'): can't open file for writing: permission denied"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fclose(f); |
|
|
|
|
|
|
|
remove(filename.c_str()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|