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
0ecb49b9
Commit
0ecb49b9
authored
May 20, 2019
by
Davis King
Browse files
Merge branch 'VirgileD-fix/jpeg'
parents
dedb7358
8746c9d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
23 deletions
+5
-23
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+0
-22
dlib/image_loader/jpeg_loader.cpp
dlib/image_loader/jpeg_loader.cpp
+5
-1
No files found.
dlib/CMakeLists.txt
View file @
0ecb49b9
...
@@ -520,7 +520,6 @@ if (NOT TARGET dlib)
...
@@ -520,7 +520,6 @@ if (NOT TARGET dlib)
external/libjpeg/jcparam.c
external/libjpeg/jcparam.c
external/libjpeg/jcprepct.c
external/libjpeg/jcprepct.c
external/libjpeg/jcsample.c
external/libjpeg/jcsample.c
external/libjpeg/jctrans.c
external/libjpeg/jdapimin.c
external/libjpeg/jdapimin.c
external/libjpeg/jdapistd.c
external/libjpeg/jdapistd.c
external/libjpeg/jdarith.c
external/libjpeg/jdarith.c
...
@@ -537,39 +536,18 @@ if (NOT TARGET dlib)
...
@@ -537,39 +536,18 @@ if (NOT TARGET dlib)
external/libjpeg/jdmerge.c
external/libjpeg/jdmerge.c
external/libjpeg/jdpostct.c
external/libjpeg/jdpostct.c
external/libjpeg/jdsample.c
external/libjpeg/jdsample.c
external/libjpeg/jdtrans.c
external/libjpeg/jerror.c
external/libjpeg/jerror.c
external/libjpeg/jerror.h
external/libjpeg/jfdctflt.c
external/libjpeg/jfdctflt.c
external/libjpeg/jfdctfst.c
external/libjpeg/jfdctfst.c
external/libjpeg/jfdctint.c
external/libjpeg/jfdctint.c
external/libjpeg/jidctflt.c
external/libjpeg/jidctflt.c
external/libjpeg/jidctfst.c
external/libjpeg/jidctfst.c
external/libjpeg/jidctint.c
external/libjpeg/jidctint.c
external/libjpeg/jinclude.h
external/libjpeg/jmemansi.c
external/libjpeg/jmemmgr.c
external/libjpeg/jmemmgr.c
external/libjpeg/jmemname.c
external/libjpeg/jmemnobs.c
external/libjpeg/jmemnobs.c
external/libjpeg/jpegtran.c
external/libjpeg/jquant1.c
external/libjpeg/jquant1.c
external/libjpeg/jquant2.c
external/libjpeg/jquant2.c
external/libjpeg/jutils.c
external/libjpeg/jutils.c
external/libjpeg/rdbmp.c
external/libjpeg/rdcolmap.c
external/libjpeg/rdgif.c
external/libjpeg/rdjpgcom.c
external/libjpeg/rdppm.c
external/libjpeg/rdrle.c
external/libjpeg/rdswitch.c
external/libjpeg/rdtarga.c
external/libjpeg/transupp.c
external/libjpeg/wrbmp.c
external/libjpeg/wrgif.c
external/libjpeg/wrjpgcom.c
external/libjpeg/wrppm.c
external/libjpeg/wrrle.c
external/libjpeg/wrtarga.c
)
)
endif
()
endif
()
set
(
source_files
${
source_files
}
set
(
source_files
${
source_files
}
...
...
dlib/image_loader/jpeg_loader.cpp
View file @
0ecb49b9
...
@@ -81,12 +81,16 @@ namespace dlib
...
@@ -81,12 +81,16 @@ namespace dlib
{
{
jpeg_error_mgr
pub
;
/* "public" fields */
jpeg_error_mgr
pub
;
/* "public" fields */
jmp_buf
setjmp_buffer
;
/* for return to caller */
jmp_buf
setjmp_buffer
;
/* for return to caller */
char
jpegLastErrorMsg
[
JMSG_LENGTH_MAX
];
};
};
void
jpeg_loader_error_exit
(
j_common_ptr
cinfo
)
void
jpeg_loader_error_exit
(
j_common_ptr
cinfo
)
{
{
/* cinfo->err really points to a jpeg_loader_error_mgr struct, so coerce pointer */
/* cinfo->err really points to a jpeg_loader_error_mgr struct, so coerce pointer */
jpeg_loader_error_mgr
*
myerr
=
(
jpeg_loader_error_mgr
*
)
cinfo
->
err
;
jpeg_loader_error_mgr
*
myerr
=
(
jpeg_loader_error_mgr
*
)
cinfo
->
err
;
/* Create the message */
(
*
(
cinfo
->
err
->
format_message
)
)
(
cinfo
,
myerr
->
jpegLastErrorMsg
);
/* Return control to the setjmp point */
/* Return control to the setjmp point */
longjmp
(
myerr
->
setjmp_buffer
,
1
);
longjmp
(
myerr
->
setjmp_buffer
,
1
);
...
@@ -127,7 +131,7 @@ namespace dlib
...
@@ -127,7 +131,7 @@ namespace dlib
*/
*/
jpeg_destroy_decompress
(
&
cinfo
);
jpeg_destroy_decompress
(
&
cinfo
);
if
(
file
!=
NULL
)
fclose
(
file
);
if
(
file
!=
NULL
)
fclose
(
file
);
throw
image_load_error
(
std
::
string
(
"jpeg_loader: error while loading image
"
)
);
throw
image_load_error
(
std
::
string
(
"jpeg_loader: error while loading image
: "
)
+
jerr
.
jpegLastErrorMsg
);
}
}
...
...
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