+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 );
+}
+
+}