Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
9c8188ee
Commit
9c8188ee
authored
Sep 30, 2014
by
Davis King
Browse files
Added missing asserts
parent
89b9dfa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
dlib/image_saver/save_jpeg.cpp
dlib/image_saver/save_jpeg.cpp
+12
-0
No files found.
dlib/image_saver/save_jpeg.cpp
View file @
9c8188ee
...
...
@@ -43,6 +43,12 @@ namespace dlib
int
quality
)
{
// make sure requires clause is not broken
DLIB_CASSERT
(
img
.
size
()
!=
0
,
"
\t
save_jpeg()"
<<
"
\n\t
You can't save an empty image as a JPEG."
);
FILE
*
outfile
=
fopen
(
filename
.
c_str
(),
"wb"
);
if
(
!
outfile
)
throw
image_save_error
(
"Can't open file "
+
filename
+
" for writing."
);
...
...
@@ -93,6 +99,12 @@ namespace dlib
int
quality
)
{
// make sure requires clause is not broken
DLIB_CASSERT
(
img
.
size
()
!=
0
,
"
\t
save_jpeg()"
<<
"
\n\t
You can't save an empty image as a JPEG."
);
FILE
*
outfile
=
fopen
(
filename
.
c_str
(),
"wb"
);
if
(
!
outfile
)
throw
image_save_error
(
"Can't open file "
+
filename
+
" for writing."
);
...
...
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