Program: gdcm
Module: $RCSfile: gdcmJpeg.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:02:18 $
- Version: $Revision: 1.40 $
+ Date: $Date: 2005/02/05 15:15:26 $
+ Version: $Revision: 1.46 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/* And we're done! */
- return true; //???
+ return true;
}
-
//-----------------------------------------------------------------------------
struct my_error_mgr {
struct jpeg_error_mgr pub; /* "public" fields */
/*
* Here's the routine that will replace the standard error_exit method:
*/
+extern "C" {
METHODDEF(void) my_error_exit (j_common_ptr cinfo) {
/* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
my_error_ptr myerr = (my_error_ptr) cinfo->err;
longjmp(myerr->setjmp_buffer, 1);
}
+//METHODDEF(void) my_output_message (j_common_ptr cinfo)
+//{
+// char buffer[JMSG_LENGTH_MAX];
+//
+// /* Create the message */
+// (*cinfo->err->format_message) (cinfo, buffer);
+//
+// // Custom display message, we could be more fancy and throw an exception:
+// gdcmErrorMacro( buffer );
+//}
+
+}
//-----------------------------------------------------------------------------
/**
// We set up the normal JPEG error routines, then override error_exit.
cinfo.err = jpeg_std_error(&jerr.pub);
+ // for any jpeg error call my_error_exit
jerr.pub.error_exit = my_error_exit;
+ // for any output message call my_output_message
+ //jerr.pub.output_message = my_output_message;
// Establish the setjmp return context for my_error_exit to use.
if (setjmp(jerr.setjmp_buffer))