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
f41ab3a3
Commit
f41ab3a3
authored
Oct 11, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34 from roynos/master
parents
0c70b456
5d9d4659
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
system.cpp
modules/core/src/system.cpp
+2
-0
loadsave.cpp
modules/highgui/src/loadsave.cpp
+4
-5
No files found.
modules/core/src/system.cpp
View file @
f41ab3a3
...
...
@@ -487,6 +487,8 @@ string tempfile( const char* suffix )
if
(
0
==
::
GetTempFileNameA
(
temp_dir
,
"ocv"
,
0
,
temp_file
))
return
string
();
DeleteFileA
(
temp_file
);
string
name
=
temp_file
;
if
(
suffix
)
{
...
...
modules/highgui/src/loadsave.cpp
View file @
f41ab3a3
...
...
@@ -308,8 +308,7 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
IplImage
*
image
=
0
;
CvMat
*
matrix
=
0
;
Mat
temp
,
*
data
=
&
temp
;
string
filename
=
tempfile
();
bool
removeTempFile
=
false
;
string
filename
;
ImageDecoder
decoder
=
findDecoder
(
buf
);
if
(
decoder
.
empty
()
)
...
...
@@ -317,10 +316,10 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
if
(
!
decoder
->
setSource
(
buf
)
)
{
filename
=
tempfile
();
FILE
*
f
=
fopen
(
filename
.
c_str
(),
"wb"
);
if
(
!
f
)
return
0
;
removeTempFile
=
true
;
size_t
bufSize
=
buf
.
cols
*
buf
.
rows
*
buf
.
elemSize
();
fwrite
(
&
buf
.
data
[
0
],
1
,
bufSize
,
f
);
fclose
(
f
);
...
...
@@ -329,7 +328,7 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
if
(
!
decoder
->
readHeader
()
)
{
if
(
removeTempFile
)
if
(
!
filename
.
empty
()
)
remove
(
filename
.
c_str
());
return
0
;
}
...
...
@@ -371,7 +370,7 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
}
bool
code
=
decoder
->
readData
(
*
data
);
if
(
removeTempFile
)
if
(
!
filename
.
empty
()
)
remove
(
filename
.
c_str
());
if
(
!
code
)
...
...
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