Commit 0ecb49b9 authored by Davis King's avatar Davis King

Merge branch 'VirgileD-fix/jpeg'

parents dedb7358 8746c9d3
...@@ -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}
......
...@@ -81,6 +81,7 @@ namespace dlib ...@@ -81,6 +81,7 @@ 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)
...@@ -88,6 +89,9 @@ namespace dlib ...@@ -88,6 +89,9 @@ namespace dlib
/* 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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment