Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
74515309
Commit
74515309
authored
Feb 06, 2020
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16509 from omasaht:imwrite-throwerr-permissiondenied
parents
6d75be03
8dd0fd8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
loadsave.cpp
modules/imgcodecs/src/loadsave.cpp
+19
-0
No files found.
modules/imgcodecs/src/loadsave.cpp
View file @
74515309
...
...
@@ -51,6 +51,8 @@
#undef max
#include <iostream>
#include <fstream>
#include <cerrno>
#include <opencv2/core/utils/logger.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
);
else
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment